Fql 查询用户喜欢按顶级类别排序


Fql query user likes sorted by top categories

现在我只使用/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 做我需要的事情吗?

No.FQL 和图形 API 都没有count()方法。要得到你想要的,你需要得到整个喜欢列表,并把它算在你的最后。