Skip to content

Instantly share code, notes, and snippets.

@bf4
Created December 22, 2010 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bf4/752075 to your computer and use it in GitHub Desktop.
Save bf4/752075 to your computer and use it in GitHub Desktop.
post_data = {}
post_data[:name] = 'Title for my link'
post_data[:link] = 'http://path.to/my/link'
post_data[:caption] = 'A caption'
post_data[:description] = 'A description'
post_data[:picture] = 'http://path.to/myimage.jpg'
post_data[:actions] = { :name => 'My site name', :link => 'http://link.to/my/site'}.to_json
client.post("feed", nil, post_data)
access_token = 'my_facebook_access_token'
page_id = 'my_facebook_page_id'
client = Mogli::Client.new(access_token)
user = Mogli::User.find("me",client)
page = user.accounts.select { |account| account.id.to_s == page_id }.first
page = Mogli::Page.new(:access_token => page.access_token)
page.client_for_page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment