1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Facebook: graph apiの形式で、fqlを利用する。

Last updated at Posted at 2012-07-01

graph apiを利用している時に、たまにfqlで情報を取りたいときがあります。
その時には、下記のように、fql prameterを利用すると取得出来ます。
行末の、localeは、その言語で登録した表記に変更されます。

https://graph.facebook.com/fql?q=select first_name,last_name,name from user where uid in ( select uid2 from friend where uid1 = me() )&locale=JP_ja

ちなみに、ruby on railsで実装するには、RestClientを利用すると便利です。
下記のような感じになります。


require "rest_client"

    _fql = "SELECT+name+,+uid+FROM+user+WHERE+uid+in+(+select+uid2+from+friend+where+uid1=me()+)"
    res = RestClient.get "https://graph.facebook.com/fql?q=#{_fql}&access_token=#{me.token}"
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?