错误的“像计数”在Facebook相册流 [英] Wrong "Like count" in Facebook Album Stream
问题描述
我们正在使用Facebook时间轴phtot流,以显示网站上的最新照片。
我们正在解析网址: http://graph.facebook.com/132827113407662/photos
如果你看第5张图片,它显示25喜欢。
如果您在fb( https://www.facebook.com/photo.php?fbid=635486689808366&set=a.132827113407662.19448.114902408533466&type=1 ),它显示31喜欢。
如何获取正确数量的喜欢。
似乎流中最大的数字( http://graph.facebook.com/ 132827113407662 / photos )ist 25.任何类似高于25的都将被忽略。
为什么?
喜欢收藏被分页。您可以阅读有关分页的更多信息 here 。
看起来似乎仍然没有办法使用图形api请求来获取所有行的数据。
但您可以通过 FQL 获取。
select like_info,object_id from photo where album_object_id = 132827113407662
返回:
{
pre>
data:[
...
{
like_info:{
can_like:true,
like_count:31,
user_likes:false
},
object_id:635486689808366
},
...
]
}
we are using the facebook timeline phtot stream, to show the last photos on the website. We are parsing the url: http://graph.facebook.com/132827113407662/photos
If you have a look at the 5th pic, it shows 25 likes. If you look at this pic on fb (https://www.facebook.com/photo.php?fbid=635486689808366&set=a.132827113407662.19448.114902408533466&type=1), it shows 31 "Likes".
How can I get the correct number of "likes". It seems, that the largest number in the stream (http://graph.facebook.com/132827113407662/photos) ist 25. Any like higher than 25 will be ignored in the stream.
Why?
解决方案Likes collection is paginated. You can read more about pagination here. Looks like there is still no way to get all rows count for a collection using graph api request. But you can get it through FQL.
select like_info, object_id from photo where album_object_id = 132827113407662
Returns:
{ "data": [ ... { "like_info": { "can_like": true, "like_count": 31, "user_likes": false }, "object_id": 635486689808366 }, ... ] }
这篇关于错误的“像计数”在Facebook相册流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!