我正在尝试使用php阅读g + fanpage的最新帖子。可惜的是,文件是不是就如何做到这一点的是有帮助的:/使用PHP(卷曲)从g + fanpage阅读帖子
到目前为止,我已经试过如下:
<?php
$curlSession = curl_init();
curl_setopt($curlSession, CURLOPT_URL, 'https://www.googleapis.com/plus/v1/people/{userID}/activities/public?key={apikey}');
curl_setopt($curlSession, CURLOPT_BINARYTRANSFER, true);
curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, true);
$jsonData = json_decode(curl_exec($curlSession));
curl_close($curlSession);
{apikey}
和{userID}
是占位符,当然。我通过开发人员控制台生成api密钥,服务器密钥和浏览器密钥都不会对下面的结果产生任何影响。 Google+ API已启动。
这是结果:
{
"error":{
"errors":[
{
"domain":"usageLimits",
"reason":"accessNotConfigured",
"message":"Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code":403,
"message":"Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
你有什么错什么建议?我错过了什么吗? 我是否必须为这种api请求提供帐单信息?
当你说“粉丝专页”时,你是指Google+社群还是Google+信息页? (在这种情况下,区别很重要。) – Prisoner
我正在讨论Google+官方页面。 – tillsanders