Rails: Posting on Facebook User Wall

We forced users to connect their Facebook accounts to our site for a couple of weeks, and I was given the task of finding a way to publish messages (i.e. advertisements) on their wall.

Essentially, it would be a cron job that will work at a specific time every day, which will send the user messages to the wall using our application in secret and their oauth2_token (which we store).

I did a few searches and I came across this post: http://ckdake.com/content/2010/posting-to-facebook-from-a-ruby-on-rails-app.html

It seems to me that I need to re-authorize users. Currently, I use only OAuth2 stone to make all my Facebook connections, and I store a user token with their user profile. I would prefer not to create a new model, just to store duplicate information.

So, did anyone do something like this? If so, could you point me in the right direction? Thanks

+3
source share
1 answer

I made a fb_graph pearl for this :)

You can publish like this.

me = FbGraph :: User.me (ACCESS_TOKEN)
me.feed! (
  : message => 'Updating via FbGraph',
)

You only need the user's access token, which should already be stored in your database.

See here for more samples.

http://github.com/nov/fb_graph

+7

All Articles