2

很长一段时间以来,我一直在使用下面的代码来获取各种链接上的点赞数。但现在它突然停止工作了。我没有对代码进行任何更改。我现在不知道在哪里寻找答案或实际出了什么问题。

这是代码:

    mysql_real_escape_string($web[$i]);
    $site="http://graph.facebook.com/?ids=".$web[$i]."";
    $graph= file_get_contents($site);
    $json_string=$graph; 
    $array  = json_decode($json_string, true);
    $var[$i] =($array[$web[$i]]['shares']);

$web 数组存储所有 URL。接下来我可以尝试什么?

4

1 回答 1

2

他们已经删除了开放的 Rest API,为了得到这个你需要在你的应用程序中实现 Oauth2.0。

The steps involved are :

1) Register your app
You will receive a CustomerKey and a Secret Code

2) Use both the Key and Code to receive an accessToken

3) Uses the same url which you are using, along with a new parameter which is accessToken=/*the one you received*/
于 2013-08-16T10:02:24.493 回答