Joel Nylund
2008-Feb-06 01:52 UTC
[Facebooker-talk] how to post to a friends news feed using facebooker
Hi, I can post to my news feed using: # publish to my feed (userF = my facebook user) @userF.publish_story((s = Facebooker::Feed::Story.new; s.title = ''joels story title''; s.body = ''joels crazy body''; s)) # publish to a friends feed (@fsession = my facebook session) fred_user = Facebooker::User.new(7779966751, at fsession) fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title = ''joels just did blah blah''; s.body = ''joels crazy body''; s)) When I do this, I get 2 stories in my feed and none in my friends feed. any ideas? I have seen the news about requiring a session to post to a feed, but I thought you could still post to your friends feeds (just not your friends friends). thanks Joel
John Bresnik
2008-Feb-06 02:11 UTC
[Facebooker-talk] how to post to a friends news feed using facebooker
Seem to recall that publishStory only sends to the current logged in user: http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser i.e. can''t really send to Fred that way - I think what you really want to use is publish_action ? also assumes that Fred is both your friend and has the app installed.. TemplatizedAction will send to all friends but its abt to be depreciated.. Not sure why youre gettn two of them tho.. probably a side effect of what youre trying do.. brez On Feb 5, 2008 5:52 PM, Joel Nylund <jnylund at yahoo.com> wrote:> Hi, I can post to my news feed using: > > # publish to my feed (userF = my facebook user) > @userF.publish_story((s = Facebooker::Feed::Story.new; s.title > ''joels story title''; s.body = ''joels crazy body''; s)) > > # publish to a friends feed (@fsession = my facebook session) > fred_user = Facebooker::User.new(7779966751, at fsession) > fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title > ''joels just did blah blah''; s.body = ''joels crazy body''; s)) > > When I do this, I get 2 stories in my feed and none in my friends feed. > > any ideas? > > I have seen the news about requiring a session to post to a feed, but > I thought you could still post to your friends feeds (just not your > friends friends). > > thanks > Joel > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >
BJ Clark
2008-Feb-06 02:23 UTC
[Facebooker-talk] how to post to a friends news feed using facebooker
Joel, You have to use the "fake session" technique. This is the method I use to create the session: def fake_session session = Facebooker::Session.create session.secure_with! self.facebook_session_key, self.facebook_uid, 0 session end The facebook_session_key is the user''s (who you''re publishing to) infinite session key. Then, any methods you call on this session look like you''re calling them from the other user, instead of the current user doing the action. Now, having said that, I''m guessing you''re actually looking to use http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction . This lets you do something like "{actor} did something to {target}" and just specify the actor''s id and any number of target ids. Hope that helps, BJ ----- BJ Clark the science department bjclark at scidept.com www.scidept.com On Feb 5, 2008, at 7:11 PM, John Bresnik wrote:> Seem to recall that publishStory only sends to the current logged in > user: > > http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser > > i.e. can''t really send to Fred that way - I think what you really want > to use is publish_action ? > > also assumes that Fred is both your friend and has the app installed.. > TemplatizedAction will send to all friends but its abt to be > depreciated.. > > Not sure why youre gettn two of them tho.. probably a side effect of > what youre trying do.. > > brez > > > On Feb 5, 2008 5:52 PM, Joel Nylund <jnylund at yahoo.com> wrote: >> Hi, I can post to my news feed using: >> >> # publish to my feed (userF = my facebook user) >> @userF.publish_story((s = Facebooker::Feed::Story.new; s.title >> ''joels story title''; s.body = ''joels crazy body''; s)) >> >> # publish to a friends feed (@fsession = my facebook session) >> fred_user = Facebooker::User.new(7779966751, at fsession) >> fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title >> ''joels just did blah blah''; s.body = ''joels crazy body''; s)) >> >> When I do this, I get 2 stories in my feed and none in my friends >> feed. >> >> any ideas? >> >> I have seen the news about requiring a session to post to a feed, but >> I thought you could still post to your friends feeds (just not your >> friends friends). >> >> thanks >> Joel >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080205/d237adc5/attachment-0001.html
Joel Nylund
2008-Feb-06 02:53 UTC
[Facebooker-talk] how to post to a friends news feed using facebooker
Thanks BJ & John, couple more questions, Is TemplatizedAction really going away or just requiring a valid session (or fake one as BJ has outlined how to do)? see http://developers.facebook.com/news.php?blog=1&story=69 So given that, if I have a valid user that is logged in to generate a story in all their friends feeds, I don''t need a fake session right? I only need this if im trying to generate news from a backend process that doesnt have a valid logged in user right? So would this work (assuming I have a valid logged in user @userF: (@userF is the current facebook user) action = Facebooker::Feed::TemplatizedAction.new action.actor_id = @userF.id action.title_template = "test from {actor} did something" action.target_ids = "comma seperated list of friend ids" @userF.publish_templatized_action(action) I got a response code of 1 for this but dont see the story in my friends account, is there a delay in posting stories? Is there a safety setting or something that if your app is not in production it will not let you post to others feeds? thanks Joel On Feb 5, 2008, at 9:23 PM, BJ Clark wrote:> Joel, > You have to use the "fake session" technique. > > This is the method I use to create the session: > def fake_session > session = Facebooker::Session.create > session.secure_with! self.facebook_session_key, > self.facebook_uid, 0 > session > end > > The facebook_session_key is the user''s (who you''re publishing to) > infinite session key. > > Then, any methods you call on this session look like you''re calling > them from the other user, instead of the current user doing the > action. > > Now, having said that, I''m guessing you''re actually looking to use http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction > . > This lets you do something like "{actor} did something to {target}" > and just specify the actor''s id and any number of target ids. > > Hope that helps, > BJ > > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > On Feb 5, 2008, at 7:11 PM, John Bresnik wrote: > >> Seem to recall that publishStory only sends to the current logged >> in user: >> >> http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser >> >> i.e. can''t really send to Fred that way - I think what you really >> want >> to use is publish_action ? >> >> also assumes that Fred is both your friend and has the app >> installed.. >> TemplatizedAction will send to all friends but its abt to be >> depreciated.. >> >> Not sure why youre gettn two of them tho.. probably a side effect of >> what youre trying do.. >> >> brez >> >> >> On Feb 5, 2008 5:52 PM, Joel Nylund <jnylund at yahoo.com> wrote: >>> Hi, I can post to my news feed using: >>> >>> # publish to my feed (userF = my facebook user) >>> @userF.publish_story((s = Facebooker::Feed::Story.new; s.title >>> ''joels story title''; s.body = ''joels crazy body''; s)) >>> >>> # publish to a friends feed (@fsession = my facebook session) >>> fred_user = Facebooker::User.new(7779966751, at fsession) >>> fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title >>> ''joels just did blah blah''; s.body = ''joels crazy body''; s)) >>> >>> When I do this, I get 2 stories in my feed and none in my friends >>> feed. >>> >>> any ideas? >>> >>> I have seen the news about requiring a session to post to a feed, >>> but >>> I thought you could still post to your friends feeds (just not your >>> friends friends). >>> >>> thanks >>> Joel >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080205/5e9c1828/attachment.html
Shane Vitarana
2008-Feb-06 03:44 UTC
[Facebooker-talk] how to post to a friends news feed using facebooker
Publish templatized feed isn''t going away, but publish action of user might since the templatized call makes it redundant. Facebook changed the rules so that only logged in active users can publish feeds. So you cannot publish it at a later time using someone else''s session key. Also, the actor_id parameter isn''t needed anymore. You still need to put {actor} somewhere in your title template though. Facebook will populate {actor} using the user who the session_key belongs to. Shane On Feb 5, 2008 8:53 PM, Joel Nylund <jnylund at yahoo.com> wrote:> Thanks BJ & John, > > couple more questions, > > Is TemplatizedAction really going away or just requiring a valid session (or > fake one as BJ has outlined how to do)? > > see http://developers.facebook.com/news.php?blog=1&story=69 > > So given that, if I have a valid user that is logged in to generate a story > in all their friends feeds, I don''t need a fake session right? I only need > this if im trying to generate news from a backend process that doesnt have a > valid logged in user right? > > So would this work (assuming I have a valid logged in user @userF: > > (@userF is the current facebook user) > action = Facebooker::Feed::TemplatizedAction.new > action.actor_id = @userF.id > action.title_template = "test from {actor} did something" > action.target_ids = "comma seperated list of friend ids" > @userF.publish_templatized_action(action) > > I got a response code of 1 for this but dont see the story in my friends > account, is there a delay in posting stories? > > Is there a safety setting or something that if your app is not in production > it will not let you post to others feeds? > > thanks > Joel > > > > > > > On Feb 5, 2008, at 9:23 PM, BJ Clark wrote: > > Joel, > You have to use the "fake session" technique. > > This is the method I use to create the session: > def fake_session > session = Facebooker::Session.create > session.secure_with! self.facebook_session_key, self.facebook_uid, 0 > session > end > > The facebook_session_key is the user''s (who you''re publishing to) infinite > session key. > > Then, any methods you call on this session look like you''re calling them > from the other user, instead of the current user doing the action. > > Now, having said that, I''m guessing you''re actually looking to use > http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction. > This lets you do something like "{actor} did something to {target}" and just > specify the actor''s id and any number of target ids. > > Hope that helps, > BJ > > > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > On Feb 5, 2008, at 7:11 PM, John Bresnik wrote: > > Seem to recall that publishStory only sends to the current logged in user: > > http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser > > i.e. can''t really send to Fred that way - I think what you really want > to use is publish_action ? > > also assumes that Fred is both your friend and has the app installed.. > TemplatizedAction will send to all friends but its abt to be > depreciated.. > > Not sure why youre gettn two of them tho.. probably a side effect of > what youre trying do.. > > brez > > > On Feb 5, 2008 5:52 PM, Joel Nylund <jnylund at yahoo.com> wrote: > Hi, I can post to my news feed using: > > # publish to my feed (userF = my facebook user) > @userF.publish_story((s = Facebooker::Feed::Story.new; s.title > ''joels story title''; s.body = ''joels crazy body''; s)) > > # publish to a friends feed (@fsession = my facebook session) > fred_user = Facebooker::User.new(7779966751, at fsession) > fred_user.publish_story((s = Facebooker::Feed::Story.new; s.title > ''joels just did blah blah''; s.body = ''joels crazy body''; s)) > > When I do this, I get 2 stories in my feed and none in my friends feed. > > any ideas? > > I have seen the news about requiring a session to post to a feed, but > I thought you could still post to your friends feeds (just not your > friends friends). > > thanks > Joel > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >-- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com