[英]Get friends read articles with Facebook JS API
i'd like to know how to fetch articles that friends have read from a Facebook app. 我想知道如何获取朋友从Facebook应用程序中阅读的文章。 I use the following query to get articles that I have read: 我使用以下查询来获取已阅读的文章:
/me/news.reads
But i want all the articles that friends have read, is that possible? 但是我想要朋友们读过的所有文章,有可能吗?
这不是一个合适的解决方案,但是您可以做的是遍历朋友的facebook id,对于每个朋友的id,所有新闻都读为/$friend_id/news:reads
我认为没有任何直接的api函数可以使操作者执行朋友们。
Try this 尝试这个
FB.api('/me/friends', { 'fields' : 'name,news.reads.limit(10)' }, function (data) {
// if(!data || data.error) { }
// console.log(data);
});
You can omit the limit if you like, or add more fields. 您可以根据需要忽略该限制,或添加更多字段。 Of course this would also work as a GET request to: http://graph.facebook.com/me/friends?fields=name,news.reads.limit(10)&access_token=XXXX
当然,这也可以作为GET请求发送到: http://graph.facebook.com/me/friends?fields=name,news.reads.limit(10)&access_token=XXXX
: http://graph.facebook.com/me/friends?fields=name,news.reads.limit(10)&access_token=XXXX
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.