A Facebook App Hack
Some days ago I had a project where it was needed to automatically post some information in Facebook.
As always, I tried to find my answer in a gem, I really don't like to "redo the wheel", but for this time and particular situation I had nothing to help me.
So I gather some pieces of information, read some facebook documentation ( and I must say it wasn't easy to reach this ).
You need to create a facebook application
You need to generate the application access token ( change to your APP_ID and APP_SECRET )
You need the gem 'rest-client' to help you do a POST request to facebook
RestClient.post "https://graph.facebook.com/#{fb_app_id}/feed", {
:access_token => access_token,
:message => 'Your awesome message in here',
:link => 'http://thinkorange.pt',
:name => 'Think Orange',
}
Maybe I will create a gem to help everyone with the same problem, for now you can copy this.









