0

现在我只使用/me/likes让我的用户喜欢对象,这给了我这个:

{
  "data": [
    {
      "category": "Community", 
      "name": "Vectorealism Staff", 
      "id": "133776533453735", 
      "created_time": "2013-01-25T18:28:31+0000"
    }, 
    {
      "category": "Media/news/publishing", 
      "name": "Done! Srl", 
      "id": "282694311753605", 
      "created_time": "2013-01-18T21:55:39+0000"
    }, 
    {
      "category": "Community", 
      "name": "Different Solutions", 
      "id": "271915499553486", 
      "created_time": "2012-09-23T17:17:23+0000"
    }, 
    {
      "category": "Non-profit organization", 
      "name": "Indigeni Digitali", 
      "id": "295601322240", 
      "created_time": "2012-01-23T19:32:13+0000"
    }, 
    {
      "category": "Cause", 
      "name": "StartupVisa", 
      "id": "10150111295350167", 
      "created_time": "2011-12-11T19:12:51+0000"
    }, 
    {
      "category": "Business services", 
      "name": "H-FARM Ventures", 
      "id": "84021019572", 
      "created_time": "2011-04-02T02:30:26+0000"
    }, 
    {
      "category": "News/media website", 
      "name": "iSpazio", 
      "id": "179295038271", 
      "created_time": "2010-05-28T21:12:28+0000"
    }, 
    {
      "category": "Website", 
      "name": "Hot Pin Venezuela", 
      "id": "110628642307976", 
      "created_time": "2010-04-20T18:45:08+0000"
    }, 
    {
      "category": "Website", 
      "name": "El Chiguire Bipolar", 
      "id": "14588159235", 
      "created_time": "2008-11-07T02:27:12+0000"
    }
  ], 
  "paging": {
    "next": "https://graph.facebook.com/1125405534/likes?limit=5000&offset=5000&__after_id=14588159235"
  }
}

在这种特殊情况下,用户的点赞数很少,但有时这个对象可能会变得非常大,我只需要根据对象上提及的次数计算出的前 5 个类别。与其检索完整的未排序对象,不如使用 FQL 来完成我需要的操作?

4

1 回答 1

0

不,FQL 和 Graph API 都没有count()方法。为了得到你想要的,你需要得到完整的喜欢列表,并在你的最后进行计数。

于 2013-01-27T17:02:03.617 回答