Skip to content

Instantly share code, notes, and snippets.

@brentsowers1
Created March 6, 2014 02:34
Show Gist options
  • Save brentsowers1/9381140 to your computer and use it in GitHub Desktop.
Save brentsowers1/9381140 to your computer and use it in GitHub Desktop.
Publishing to a users wall with Facebooker
# load access token and expiration from database
client = Mogli::Client.new(access_token, expiration)
user = Mogli::User.find(facebook_id, client)
post = {:name => "main title for the post",
:caption => "Sub title for the post",
:description => "Long description for the post",
:picture => "url to a picture for the post",
:link => "url to go to when the user clicks on the title",
:from => {:name => "Your app's name",
:category => "Your app's category",
:id => Facebooker2.app_id},
:actions => [{:name => "Name of the action link at the bottom of the post (beside like and comment)",
:link => "URL to go to when user clicks on this link"}]
}
user.client.post("me/feed", nil, post)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment