1

所以我的目标似乎很简单,就是获取当天的墙帖数量。我一直在使用图形 API insights/page_wall_posts,直到我意识到计数不正确。有没有更好的统计数据可以使用?我确实在 FQL 文档中看到过,page_wall_post is depreciated但它没有说明它是否被其他东西取代。

我的问题是:

  1. 如何获得一天所有墙帖的计数?
  2. 同样,我如何才能在当天的墙上获得全部评论?

我有解析结果的代码,但是当我昨天使用图形浏览器进行测试时, 我发现返回的数据与 Facebook 上的实际活动相差甚远。

4

2 回答 2

0

所以我的问题的答案是获取这些数据的下一个最佳方法是使用:

insights/page_stories_by_story_type. 它将返回如下内容:

"data": [
{
  "id": "<THE ID>/insights/page_stories_by_story_type/day", 
  "name": "page_stories_by_story_type", 
  "period": "day", 
  "values": [
    {
      "value": {
        "fan": 10, 
        "page post": 8, 
        "user post": 3, 
        "checkin": 1
      }, 
      "end_time": "2012-02-05T08:00:00+0000"
    }, 

page_post 值将包括 post+comments。这是我使用洞察数据能找到的最好的。

于 2012-02-09T19:22:12.983 回答
0

I've seen some inconsistencies as well between data available to the Graph and what is actually seen via the Facebook UI.

However, if you can live with relying on the results from the Graph API, you do have some ways of getting the information you're after. If it involved pagination of results, you may be disappointed in the results.

You can run FQL thru the graph API (and even from the Graph API Explorer). Try

fql?q=SELECT post_id, comments, message FROM stream WHERE source_id=me() AND created_time > 1326064184 AND created_time < 1326634407

From this query you get the stream items for the user as well as the comments object for each of those posts.

If you are looking to pull comments counts for a time period on the user's posts, then you can use: fql?q=SELECT object_id, text, time FROM comment WHERE post_id IN (SELECT post_id FROM stream WHERE source_id=me()) AND time > 1326064184 AND time < 1326634407

于 2012-01-15T16:20:01.643 回答