I am working on integrating Omniauth with my new Facebook application, and I am looking through the rather sparse documentation to understand if it gives simple ways to access the graph API… I am moving from Koala which was pretty simple.
Has anyone out there used Omniauth for this yet? I want to get photos from the users’ albums, and sort and get the unique URLs for them.
So I wasn’t able to get fb_graph to work properly – I am still a noob having been a Ruby On Rails developer for a total of about 8-10 weeks, and therefore don’t have an instinct for what must be obvious problems to other folks.
However I found this great little blog post which outlines a simple facebook client and shows clearly how it all plugs together. I found an issue with it picking up the me/picture object as Facebook returns an http302 not http200 but that was easily worked around with the help of the author. Check it out: http://bnerd.de/misc/ruby-write-basic-client-for-facebook-graph-api/
I am now using Omniauth for the simplicity of the login/signup interaction based on this walkthrough here: blog.railsrumble.com/blog/2010/10/08/intridea-omniauth and with the token I get from that I am using this simple FBClient from the bnerd reference above to access the Graph API. Hope what I found helps others.
…here’s my version of bnerd’s code and it worked for me:
I am sure someone more experienced than I could improve this – I was about 10 weeks into learning Ruby (and my first programming since Fortran and Pascal at university in the early 90s!).