2012-11-20 50 views
0

爲什麼這兩個查詢返回不同的計數? ?Facebook圖形API fql查詢類似計數與直接對象查找

1)FQL q ...查詢返回0喜歡

https://graph.facebook.com/fql?q=SELECT+url%2C+normalized_url%2C+share_count%2C+like_count%2C+comment_count%2C+total_count%2C+commentsbox_count%2C+comments_fbid%2C+click_count+FROM+link_stat+WHERE+url%3D%27http%3A%2F%2Fwww.facebook.com%2Fpages%2FLine-And-Circle%2F49561759728%27 

回報:

{ 
    "data": [ 
    { 
     "url": "http://www.facebook.com/pages/Line-And-Circle/49561759728", 
     "normalized_url": "http://www.facebook.com/pages/Line-And-Circle/49561759728", 
     "share_count": 0, 
     "like_count": 0, 
     "comment_count": 0, 
     "total_count": 0, 
     "commentsbox_count": 0, 
     "comments_fbid": null, 
     "click_count": 0 
    } 
] 
} 

2)直接對象查詢返回436喜歡

https://graph.facebook.com/49561759728 

回報:

{ 
    "name": "Line & Circle", 
    "is_published": true, 
    "website": "http://lineandcirclemusic.tumblr.com/", 
    "description": "follow \u0040LineAndCircle", 
    "about": "Echo Park, Los Angeles via the Midwest, USA. http://lineandcirclemusic.tumblr.com/", 
    "genre": "Indie/Alternative", 
    "hometown": "Los Angeles, California", 
    "current_location": "Los Angeles, California", 
    "record_label": "White Iris", 
    "press_contact": "lineandcirclemusic\u0040gmail.com", 
    "influences": "Richard Neutra, Erik Satie, Lord Byron, Richard Yates, Grace Kelly, Phil Hartman, Bobby Briggs, Denard Robinson, etc.", 
    "band_interests": "Ice cream, ice fishing, etc.", 
    "category": "Musician/band", 
    "id": "49561759728", 
    "link": "https://www.facebook.com/pages/Line-Circle/49561759728", 
    "likes": 436, 
    "cover": { 
     "cover_id": "10151094140979729", 
     "source": "http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s720x720/391388_10151094140979729_1992918206_n.jpg", 
     "offset_y": 31 
    } 
} 

在其他實例中,如用戶名「newfoundglory」,fql查詢返回的結果與類似計數接近,但仍與直接查詢不同。

爲什麼這兩個查詢返回不同的結果?

回答

0

第一個圖形調用返回0喜歡,如預期的那樣,因爲該表用於追蹤外部url的喜歡和評論,而不是Facebook上的內部頁面。
爲了獲得這些數據,你應該使用頁表和查詢fan_count -

select page_id, name, page_url, fan_count from page where name = 'Line & Circle' 

這將返回預期的結果 -

"data": [ 
{ 
    "page_id": 49561759728, 
    "name": "Line & Circle", 
    "page_url": "https://www.facebook.com/pages/Line-Circle/49561759728", 
    "fan_count": 436 
} 
]