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

时间:2013-01-27 15:22:28

标签: php facebook facebook-fql

现在我只是使用 / 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来完成我需要的工作吗?

1 个答案:

答案 0 :(得分:0)

没有。 FQL和Graph API都没有count()方法。为了得到你想要的东西,你需要获得所有喜欢的列表,并在你的最后计算。