【问题标题】:Get all Friends using FQL使用 FQL 获取所有好友
【发布时间】:2014-06-27 06:37:37
【问题描述】:

我的代码在这里

query = "SELECT uid FROM USER " +
        "WHERE uid IN (" +
        "  SELECT uid2 FROM friend WHERE uid1 = #{fb_user_id}" +
        ")"

url = "https://graph.facebook.com/fql?q=#{query}&access_token=#{fb_access_token}"
escape_url = URI::escape(url)
uri = URI.parse(escape_url)

# Configure http settings to hit a url.
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
# extract the response body.
response = JSON.parse(response.body)

它只返回

10 个朋友

我想提取所有朋友我该怎么做 提取所有好友列表的任何其他方式 请有人帮助我

【问题讨论】:

    标签: ruby facebook-graph-api facebook-fql


    【解决方案1】:

    除非您使用的是 v1.0 应用程序,否则 API 调用只会返回使用该应用程序的朋友。

    好友列表现在仅返回也使用您的应用的好友:通过 /me/friends 端点返回的好友列表现在仅限于已授权您的应用的好友列表。

    https://developers.facebook.com/docs/apps/changelog

    这也适用于 FQL 朋友表。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多