Javascript 使用facebook graph api的facebook页面浏览量
我正在使用facebook graph api的url获取页面视图,并获得以下回报:Javascript 使用facebook graph api的facebook页面浏览量,javascript,facebook,facebook-graph-api,facebook-javascript-sdk,facebook-like,Javascript,Facebook,Facebook Graph Api,Facebook Javascript Sdk,Facebook Like,我正在使用facebook graph api的url获取页面视图,并获得以下回报: { "data": [], "paging": { "previous": "https://graph.facebook.com/v2.3/1570694813193723/insights/page_views/lifetime?debug=all&pretty=0&suppress_http_code=1&since=1428476277&u
{
"data": [],
"paging": {
"previous": "https://graph.facebook.com/v2.3/1570694813193723/insights/page_views/lifetime?debug=all&pretty=0&suppress_http_code=1&since=1428476277&until=1428735477",
"next": "https://graph.facebook.com/v2.3/1570694813193723/insights/page_views/lifetime?debug=all&pretty=0&suppress_http_code=1&since=1428994677&until=1429253877"
}
}
在某些查询中,日期时间错误必须是unix或日期时间格式。我可以和你分享我的访问令牌。我迫切需要页面浏览量,并且还告诉我,自从和直到格式化,这些都在文档中。请花点时间提出一个可读的问题 电话应该是
/{page_id}/insights/page_views?period=day&since=1427846400&until=1429142400&access_token={access_token}
将{access_token}替换为具有read_insights权限的实际访问令牌,{page_id}替换为页面id。这将返回从4月1日到4月15日的每日页面浏览量
看
错误:无效响应问题仍然存在。我怀疑您运行的请求是否正确。您是否添加了具有读取权限的用户或页面访问令牌?函数p_post{FB.api/209652442394600?字段=posts{admin_creator},函数response{var t=response.posts.data.length;};}现在作为回应,默认情况下我得到了25条,但是如果它增加了25条帖子或视图,那么如何处理它呢?这段代码和你的问题有什么关系?没什么。顺便说一句,这是我最后的评论。把你的事情做完。
function p_view()
{
//data:Array[10],
FB.api("/144765045682596/insights/page_views?period=day&since=1427846400&until=1429142400", function (response) {
for (var i = 0; i < response.data.length; i++)
{
var thread = response.data[i].values;
var s=13;
//if (thread.values[13] == thread.values[i])
//{
var tm = thread[s].end_time;
var th = thread[s].value;
document.getElementById('datev').innerHTML = tm;
document.getElementById('viewers').innerHTML = th;
// var values = thread.values;
// //var comment = thread.
//}
}
});
}