Project

fql

No commit activity in last 3 years
No release in over 3 years
A simple gem to easily use the Facebook Query Language. Just specify single queries as strings or use hashes to compose multiqueries and send them to Facebook using `Fql.execute(query)`.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

Fql

Build Status Code Climate

Easily execute FQL queries with this gem.

Download and installation

The latest version of fql can be installed with RubyGems:

$ gem install fql

If you're using Bundler, you can add it to your Gemfile:

gem 'fql'

Examples

Exampe: a single query without access_token

  Fql.execute('SELECT first_name, last_name FROM user WHERE uid = 4')
  # => [{"first_name"=>"Mark", "last_name"=>"Zuckerberg"}]

Exampe: a multi query with an access_token

  options = { :access_token => "fb_access_token" }
  Fql.execute({
    "query1" => "SELECT uid, rsvp_status FROM event_member WHERE eid = 209798352393506 LIMIT 3",
    "query2" => "SELECT name FROM user WHERE uid IN (SELECT uid FROM #query1)"
  }, options)
  # => [{"name"=>"query1", "fql_result_set"=>[{"uid"=>712638919, "rsvp_status"=>"attending"}, {"uid"=>711903876, "rsvp_status"=>"attending"}, {"uid"=>711447283, "rsvp_status"=>"attending"}]}, {"name"=>"query2", "fql_result_set"=>[{"name"=>"Srikanth Nagandla"}, {"name"=>"Hinling Yeung"}, {"name"=>"G\u00F6khan Olgun"}]}]
  # Or the same result but formatted:
  # [
  #   {"name"=>"query1", "fql_result_set"=>[{"uid"=>712638919, "rsvp_status"=>"attending"}, {"uid"=>711903876, "rsvp_status"=>"attending"}, {"uid"=>711447283, "rsvp_status"=>"attending"}]}, 
  #   {"name"=>"query2", "fql_result_set"=>[{"name"=>"Srikanth Nagandla"}, {"name"=>"Hinling Yeung"}, {"name"=>"G\u00F6khan Olgun"}]}
  # ]

This project rocks and uses MIT-LICENSE.