I''m authoring my first facebooker app and my first FB App - and trying to wrap my head around it all. I''ve gotten everything to work in the install/However, I''m not certain how to get the profile box to display/update. Are there any good tutorials or explanations of how to get Facebooker to update a users'' profile box? I tried using profile_fbml=("Here is a bit of test data") as part of the successful install method in my controller, and have been consistently getting errors. Any tips would be greatly appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/e1234921/attachment.html
Brad, I highly recommend making yourself very familiar with http://wiki.developers.facebook.com/index.php/Main_Page You''re probably getting errors because of malformed api calls. You can see what''s required for each call on the wiki. Good Luck, ----- BJ Clark the science department bjclark at scidept.com www.scidept.com On Mar 4, 2008, at 2:30 PM, Brad Hubbard wrote:> I''m authoring my first facebooker app and my first FB App - and > trying to wrap my head around it all. I''ve gotten everything to work > in the install/However, I''m not certain how to get the profile box > to display/update. Are there any good tutorials or explanations of > how to get Facebooker to update a users'' profile box? > > I tried using profile_fbml=("Here is a bit of test data") as part of > the successful install method in my controller, and have been > consistently getting errors. > > Any tips would be greatly appreciated. > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Also, as I just learned, check out Facebooker''s Publisher class to updating profile, sending notifications, etc. On 3/4/08, Brad Hubbard <brad at bradhubbard.net> wrote:> > I''m authoring my first facebooker app and my first FB App - and trying to > wrap my head around it all. I''ve gotten everything to work in the > install/However, I''m not certain how to get the profile box to > display/update. Are there any good tutorials or explanations of how to get > Facebooker to update a users'' profile box? > > I tried using profile_fbml=("Here is a bit of test data") as part of the > successful install method in my controller, and have been consistently > getting errors. > > Any tips would be greatly appreciated. > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >-- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/ec30a040/attachment.html
Brad, you have to pass fbml markup to that method <% @userF.profile_fbml = ''<fb:wide>Joel is a cool dude </fb:wide>'' %> or <% @userF.profile_fbml = ''<fb:narrow>Joel is a cool dude</fb:narrow>'' %> While were on this topic, are you guys putting settings/etc in the profile still? It seems to me since users can just remove the box but keep your app, its better to put settings inside your applications tab set, thats what im doing but I was wondering what others thought.. see my previous posting to debug api calls, or Davids approach in his tutorial (monkey patch) Joel On Mar 4, 2008, at 4:30 PM, Brad Hubbard wrote:> I''m authoring my first facebooker app and my first FB App - and > trying to wrap my head around it all. I''ve gotten everything to work > in the install/However, I''m not certain how to get the profile box > to display/update. Are there any good tutorials or explanations of > how to get Facebooker to update a users'' profile box? > > I tried using profile_fbml=("Here is a bit of test data") as part of > the successful install method in my controller, and have been > consistently getting errors. > > Any tips would be greatly appreciated. > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Probably worth mentioning that the example for the Publisher methods in the rdocs are not accurate. For example, the rdocs give this as an example to update the user profile: def profile_update(user_to_update,user_with_session_to_use) from user_with_session_to_use to user_to_update profile render(:action=>"/users/ profile",:assigns=>{:user=>user_to_update}) end However, you need something more like this: def profile_update(user_to_update,user_with_session_to_user) send_as :profile from user_with_session_to_use recipients user_to_update profile render(:action=>"/users/ profile",:assigns=>{:user=>user_to_update}) end Notice the lack of the send_as :profile in the rdoc example and "to" changing to "recipients". This is also the case with templatized actions. Just FYI. -Joel
And I''ve had problems using full actions, so am using partials instead (which actually is more intuitive to me given that you aren''t generating a whole page, but just a snippet of FBML for use in a page, but whatever). Anyway, assuming for something like a profile that the user himself is who is updating his profile (not sure it''s "legal" to have one user update another''s profile :) I have this: def profile_update(user) send_as :profile recipients user profile render(:partial => "profile", :assigns => { :user => user }) end On 3/4/08, Joel Watson <joel at i5labs.com> wrote:> > Probably worth mentioning that the example for the Publisher methods > in the rdocs are not accurate. For example, the rdocs give this as an > example to update the user profile: > > def profile_update(user_to_update,user_with_session_to_use) > from user_with_session_to_use > to user_to_update > profile render(:action=>"/users/ > profile",:assigns=>{:user=>user_to_update}) > end > > However, you need something more like this: > > def profile_update(user_to_update,user_with_session_to_user) > send_as :profile > from user_with_session_to_use > recipients user_to_update > profile render(:action=>"/users/ > profile",:assigns=>{:user=>user_to_update}) > end > > Notice the lack of the send_as :profile in the rdoc example and "to" > changing to "recipients". This is also the case with templatized > actions. Just FYI. > -Joel > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/bc60e49b/attachment.html
I tried moving over to the Facebooker publisher method. My publisher controller is: class PublisherController < Facebooker::Rails::Publisher def profile_update(user) send_as :profile recipients user profile render(:partial => "profile", :assigns => { :user => user }) end end My partial is _profile.erb: <fb:wide>Not working just yet. One can always hope!</fb:wide> And my canvas controller calls: PublisherController.deliver_profile_update(@fb_user) I get (in my error logs): Facebooker::Rails::Publisher::UnknownBodyType (Unknown type to publish): I''ve got "send as :profile" in there - I''m not sure what I''m doing wrong. -Brad On Tue, Mar 4, 2008 at 5:04 PM, Christopher Bailey <chris at cobaltedge.com> wrote:> And I''ve had problems using full actions, so am using partials instead > (which actually is more intuitive to me given that you aren''t generating a > whole page, but just a snippet of FBML for use in a page, but whatever). > Anyway, assuming for something like a profile that the user himself is who > is updating his profile (not sure it''s "legal" to have one user update > another''s profile :) I have this: > > def profile_update(user) > send_as :profile > recipients user > profile render(:partial => "profile", :assigns => { :user => user }) > end > > > > On 3/4/08, Joel Watson <joel at i5labs.com> wrote: > > > Probably worth mentioning that the example for the Publisher methods > > in the rdocs are not accurate. For example, the rdocs give this as an > > example to update the user profile: > > > > def profile_update(user_to_update,user_with_session_to_use) > > from user_with_session_to_use > > to user_to_update > > profile render(:action=>"/users/ > > profile",:assigns=>{:user=>user_to_update}) > > end > > > > However, you need something more like this: > > > > def profile_update(user_to_update,user_with_session_to_user) > > send_as :profile > > from user_with_session_to_use > > recipients user_to_update > > profile render(:action=>"/users/ > > profile",:assigns=>{:user=>user_to_update}) > > end > > > > Notice the lack of the send_as :profile in the rdoc example and "to" > > changing to "recipients". This is also the case with templatized > > actions. Just FYI. > > -Joel > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080305/69f3c0a6/attachment.html
What version of rails are you using? If you''re using Rails 2.x and your partial is actually named "_profile.erb", then you might try renaming it to "_profile.html.erb". Not sure if that has anything to do with it, but worth a shot. -Joel On Mar 5, 2008, at 1:10 PM, Brad Hubbard wrote:> I tried moving over to the Facebooker publisher method. > > My publisher controller is: > class PublisherController < Facebooker::Rails::Publisher > def profile_update(user) > send_as :profile > recipients user > profile render(:partial => "profile", :assigns => { :user => > user }) > end > end > > My partial is _profile.erb: > <fb:wide>Not working just yet. One can always hope!</fb:wide> > > And my canvas controller calls: > PublisherController.deliver_profile_update(@fb_user) > > I get (in my error logs): > Facebooker::Rails::Publisher::UnknownBodyType (Unknown type to > publish): > I''ve got "send as :profile" in there - I''m not sure what I''m doing > wrong. > > -Brad
Well, if you do a search in the facebooker code you''ll see that only gets generated from publisher.rb send_as, which doesn''t accept :profile as one of the options. I don''t think the publisher profile methods that are documented are actually implemented yet. Perhaps you should try set_profile_fbml in Facebooker::User? I don''t actually see anything about profiles in any of the tutorials yet, and I haven''t done it yet myself (I will be though). --simon> I tried moving over to the Facebooker publisher method. > > My publisher controller is: > class PublisherController < Facebooker::Rails::Publisher > def profile_update(user) > send_as :profile > recipients user > profile render(:partial => "profile", :assigns => { :user => > user }) > end > end > > My partial is _profile.erb: > <fb:wide>Not working just yet. One can always hope!</fb:wide> > > And my canvas controller calls: > PublisherController.deliver_profile_update(@fb_user) > > I get (in my error logs): > Facebooker::Rails::Publisher::UnknownBodyType (Unknown type to > publish): > I''ve got "send as :profile" in there - I''m not sure what I''m doing > wrong.-- http://simonwoodside.com -- http://simonwoodside.com
Actually, send_as does accept :profile, see the threads in the last day or two, but the below code should work as long as you are on the latest Facebooker code. Is your Facebooker code the latest? On 3/5/08, S. Woodside <sbwoodside at yahoo.com> wrote:> > Well, if you do a search in the facebooker code you''ll see that only > gets generated from publisher.rb send_as, which doesn''t > accept :profile as one of the options. I don''t think the publisher > profile methods that are documented are actually implemented yet. > > Perhaps you should try set_profile_fbml in Facebooker::User? > > I don''t actually see anything about profiles in any of the tutorials > yet, and I haven''t done it yet myself (I will be though). > > --simon > > > I tried moving over to the Facebooker publisher method. > > > > My publisher controller is: > > class PublisherController < Facebooker::Rails::Publisher > > def profile_update(user) > > send_as :profile > > recipients user > > profile render(:partial => "profile", :assigns => { :user => > > user }) > > end > > end > > > > My partial is _profile.erb: > > <fb:wide>Not working just yet. One can always hope!</fb:wide> > > > > And my canvas controller calls: > > PublisherController.deliver_profile_update(@fb_user) > > > > I get (in my error logs): > > Facebooker::Rails::Publisher::UnknownBodyType (Unknown type to > > publish): > > I''ve got "send as :profile" in there - I''m not sure what I''m doing > > wrong. > > > > -- > http://simonwoodside.com > > > > > > -- > http://simonwoodside.com > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080305/b7b23951/attachment.html
Damn, I thought that ./script/plugins update would automatically go out to facebooker''s SVN and pull the latest, but I guess it doesn''t. I switched to having vendor/plugins/facebooker being pulled directly via my own svn commands, and now I see that I was indeed out of date. The suck! Now I''ve got to redo my patches as well, bummer. --simon -- http://simonwoodside.com On Mar 6, 2008, at 12:23 AM, Christopher Bailey wrote:> Actually, send_as does accept :profile, see the threads in the last > day or two, but the below code should work as long as you are on > the latest Facebooker code. Is your Facebooker code the latest? > > On 3/5/08, S. Woodside <sbwoodside at yahoo.com> wrote: Well, if you > do a search in the facebooker code you''ll see that only > gets generated from publisher.rb send_as, which doesn''t > accept :profile as one of the options. I don''t think the publisher > profile methods that are documented are actually implemented yet. > > Perhaps you should try set_profile_fbml in Facebooker::User? > > I don''t actually see anything about profiles in any of the tutorials > yet, and I haven''t done it yet myself (I will be though). > > --simon > > > I tried moving over to the Facebooker publisher method. > > > > My publisher controller is: > > class PublisherController < Facebooker::Rails::Publisher > > def profile_update(user) > > send_as :profile > > recipients user > > profile render(:partial => "profile", :assigns => { :user => > > user }) > > end > > end > > > > My partial is _profile.erb: > > <fb:wide>Not working just yet. One can always hope!</fb:wide> > > > > And my canvas controller calls: > > PublisherController.deliver_profile_update(@fb_user) > > > > I get (in my error logs): > > Facebooker::Rails::Publisher::UnknownBodyType (Unknown type to > > publish): > > I''ve got "send as :profile" in there - I''m not sure what I''m doing > > wrong. > > > > -- > http://simonwoodside.com > > > > > > -- > http://simonwoodside.com > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com