获取Facebook页面喜欢PHP(FQL折旧后)

时间:2016-08-19 21:43:06

标签: php facebook facebook-graph-api facebook-fql

我曾经能够在Facebook上使用单个FQL查询URL获取页面。但截至上周,他们将其关闭。要求使用他们的SDK或API,但我的系统会扫描用户的Facebook页面并显示他们的页面喜欢。

我有什么方法可以解决这个问题,就像我使用SDK或API一样。我需要为每个页面的每个请求提供一个应用程序。

感谢。

注意: 我尝试使用标题&用户代理与file_get_contents()&尝试在手机上请求无济于事。

代码:

$url = "http://m.facebook.com/pagename/";

$options = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"Accept-language: en\r\n" .
              "User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7\r\n" 
  )
);

$context = stream_context_create($options);
$file = file_get_contents($url, false, $context);

print_r($file);

结果:

enter image description here

1 个答案:

答案 0 :(得分:1)

不知道为什么这个问题被贬低了。以前我们曾经使用fql获得/ share count,这是在8月7,2016之后折旧的。我们可以使用这个技巧来获得相同的数量。

只需向facebook&解析结果。

WPF

查看此帖子以获取详细说明:get facebook like/share count after fql depreciation