This is just a simple example for connecting to facebook with OAUTH2.
With this you can do all the reading and writing stuff to facebook.
See the Koala Docs for more.
From that on, its better to read the Koala documentation, use the Graph Explorer from Facebook and read the Facebook API Documentation to get an idea what you can do after the authentication.
GETTING STARTED
- Clone the repository
- Run bundle inside the folder
- Change APP_ID, APP_SECRET (get this from facebook by registering an app)
- Add an URL like local.myapp.com pointing to 127.0.0.1 in your
/etc/hosts
file - Add local.myapp.com to your App Domains list on facebook
- Set a long and random string as cookie secret (Line: 12)
- Start your Server with
$ shotgun
- point your browser to
http://local.myapp.com:9393/
and click login
DOING MORE
At this point you can make calls to the Facebook API (there are some examples in the comment): https://github.com/benben/simple-ruby-facebook-example/blob/master/lib/simple-ruby-facebook-example.rb#L17-L23From that on, its better to read the Koala documentation, use the Graph Explorer from Facebook and read the Facebook API Documentation to get an idea what you can do after the authentication.
KUDOS
Made with the help of this two awesome gems:- Sinatra -> http://www.sinatrarb.com/
- Koala -> http://github.com/arsduo/koala