The Open Graph protocol enables developers to integrate their pages into the social graph. These pages gain the functionality of other graph objects including profile links and stream updates for connected users. Documentations for facebook api are available on this link.
Ruby offer a library to communicate with Facebook Graph named “rfgraph”.
To install :

  1. $ sudo gem install rfgraph

Next, you can write your code. We will use this library to retrieve user information for a range of id. For this, we will create a loop from 610552189 ( my id) to 610552219 (another id) and show available information :

  1. require ‘rubygems’
  2. require ‘rfgraph’
  4. req =
  6. for i in 610552189..610552219 do
  7.   begin
  8.     res= req.get_object(i)
  9.     puts "#{res[‘id’]} #{res[‘name’]} #{res[‘first_name’]} #{res[‘last_name’]}"+
  10.       " #{res[‘gender’]} #{res[‘locale’]} #{res[‘link’]}"
  11.   rescue Exception=>e
  12.   end
  13. end

and the result will be :

  1. 610552189 Nihed Mbarek Nihed Mbarek male fr_FR
  2. 610552198 Stephanie Pedrin Stephanie Pedrin  es_LA
  3. 610552201 Roz Rossington Roz Rossington female en_GB
  4. 610552204 Timbucktwo Hair Timbucktwo Hair  en_US
  5. 610552207 Arkoun Merchant Arkoun Merchant male en_US
  6. 610552210 Gulcin Takmaz Gulcin Takmaz female en_GB
  7. 610552213 Lara Mezzanotte Lara Mezzanotte  en_US
  8. 610552217 Kita Collier-Smith Kita Collier-Smith female en_US

For more information :

PS : I hope that facebook block user that try to retreive a large number of information.