Skip to content

Instantly share code, notes, and snippets.

@bf4 bf4/content_post.rb
Created Dec 22, 2010

Embed
What would you like to do?
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
You can’t perform that action at this time.