1

我正在尝试在 PHP 中使用 FQL 查询 FB 以获取页面流,并且我获得了除展示次数之外的所有数据。使用的 FB_ACCESS_TOKEN 是我的 FB 应用程序的 OAuth 令牌,我已授予以下范围:offline_access,manage_pages,email,read_insights,sms,publish_stream

代码示例:

$this->fb->api(array(
  "method" => "fql.multiquery",
  "queries" => json_encode(array(
    "post" => "SELECT post_id, source_id, updated_time, created_time, actor_id, 
                      message, attachment, impressions, likes, privacy, 
                      permalink, comments 
               FROM stream WHERE source_id='".$source_id."' 
                           AND created_time > '".$date_updated."'",
    "comment" => "SELECT post_id, fromid, time, text, id, likes, object_id 
                  FROM comment WHERE post_id IN (SELECT post_id FROM #post) 
                               AND time> '".$date_updated."'"
  )), access_token" => FB_ACCESS_TOKEN
));

这是示例输出:

[...]
[0] => Array(
  [post_id] => 107112482661088_236459409726394
  [source_id] => 107112482661088
  [updated_time] => 1312884237
  [created_time] => 1312884237
  [actor_id] => 608795063
  [message] => funker jo ikke detta nå da :( får ikke spilt i det hele tatt :@
  [attachment] => Array(
    [description] => 
  )
  [impressions] => 
  [likes] => Array(
    [href] => http://www.facebook.com/browse/?type=likes&id=236459409726394
    [count] => 0
    [sample] => Array()
    [friends] => Array()
    [user_likes] => 
    [can_like] => 
  )
  [privacy] => Array(
    [value] => 
  )
  [permalink] => http://www.facebook.com/hacktheplanet.no/posts/236459409726394
  [comments] => Array(
    [can_remove] => 
    [can_post] => 
    [count] => 0
    [comment_list] => Array()
  )
)
[...]

我没有获得展示数据的任何建议或原因?

4

1 回答 1

0

您是否尝试过对几天前的帖子进行此查询?

Facebook Insights 似乎通常会落后 24 到 48 小时,我相信这是展示次数价值的来源。

为了验证,我对今天在我拥有 read_insights 权限的页面上创建的帖子运行了 FQL 查询。“展示次数”的结果为空(如您的示例中所示)。

然后,我对三天前的帖子运行了相同的查询,并且存在展示次数。

于 2011-11-30T05:10:51.680 回答