Facebook Graph和PHP API [英] Facebook Graph and PHP API
本文介绍了Facebook Graph和PHP API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在这个工作了几个小时,但是糟糕的文档没有任何帮助。
I've been working at this for a few hours, but the poor documentation is of no help.
我想做的就是抓住存在的数据以 https://graph.facebook.com/cocacola/ 为例,我甚至不能
All I want to do is grab the data that exists at https://graph.facebook.com/cocacola/ as an example, and I cant even do that.
我在Facebook上使用最新的php API。
I'm using the latest php API from facebook.
这是我的代码,其中不返回任何内容:
This is my code, which returns nothing:
<?php
require '../src/facebook.php';
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => '254752073152',
'secret' => '904270b68a2cc3d54485323652da4d14',
'cookie' => true,
));
$coke = $facebook->api('/cocacola');
echo '<pre>';
print_r($coke);
echo '</pre>';
任何想法?
推荐答案
对不起,我无法评论,但这看起来不是一个有效的API密钥(不够长)。应用程序ID应该是您的 API密钥 cappId
Sorry I can't comment, but that doesn't look like a valid API key (not long enough). The 'appId'
should be your API key not your Application ID.
这篇关于Facebook Graph和PHP API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文