【问题标题】:Facebook FQL is deprecated, but there's no way to directly get friend_count with Graph API?Facebook FQL 已弃用,但无法使用 Graph API 直接获取friend_count?
【发布时间】:2014-06-24 22:05:07
【问题描述】:

使用 FQL,我可以通过以下方式轻松获取用户的朋友数:

SELECT uid,friend_count FROM user WHERE uid IN (<list of user ids/>)

但它看起来像使用 Graph API,我必须发出请求,直到分页用完,然后使用类似的东西计算返回了多少结果:

array(
    'method' => 'GET',
    'relative_url' => 'me/friends?access_token='. $token
)

我尝试过使用

array(
    'method' => 'GET',
    'relative_url' => 'me/friends?summary=true&access_token='. $token
)

但这没有用。是否有单个 Graph API 请求可以获得用户的好友数?如果没有,我该如何提出功能请求?

【问题讨论】:

    标签: facebook-graph-api facebook-fql


    【解决方案1】:

    自 v2.1 发布以来,Facebook 为 Graph API 实现了此功能:

    /friends 用户对象上的边缘现在提供对好友总数的访问。这在 v2.0 中也得到了追溯支持。

    Graph-API-v2.1

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多