帖子喜欢的数量和喜欢的数据之间的差异? [英] Difference between a post's likes count and the likes data?

查看:135
本文介绍了帖子喜欢的数量和喜欢的数据之间的差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到Graph API中报告的喜好数量与数据中的喜欢帖子的人的姓名和ID的数量有差异。

I'm seeing a discrepancy between the number of likes reported in the Graph API vs the number of entries in the "data" that has the name and ID of the people who liked a post.


  • 当我在Facebook上查看某个帖子时,我看到有5个人喜欢。

  • 当我使用Graph API用于获取帖子,喜欢字段有一个数据字段,其中有3个条目,count字段的值为5。

  • 当我使用Graph API来获取帖子的喜欢(例如,{post_id} / likes),我得到一个数据字段,其中有5个条目(没有计数字段)。

很明显,有多少人喜欢这篇文章的真正答案是5.但是为什么我在获取帖子对象时只有数据中有3个条目?

Clearly the true answer to how many people have liked the post is 5. But then why is there only 3 entries in the "data" when I fetch the post object?

这是另一个同样差异的例子:

Here's another example of the same discrepancy:

https://graph.facebook.com/40796308305_10150394134258306 返回一个帖子的数据,其喜欢/数据只有1个条目,但其喜欢/计数说有3个。但是 https://graph.facebook.com/40796308305_10150394134258306/likes 返回3条目的数据。在可口可乐页面上找到同样的条目,实际上有3个人喜欢它。

https://graph.facebook.com/40796308305_10150394134258306 returns data for a post whose "likes/data" only has 1 entry in it, but whose "likes/count" says that there are 3. But https://graph.facebook.com/40796308305_10150394134258306/likes returns "data" with 3 entries. Finding that same entry on Coca-Cola's page finds that there are, in fact, 3 people who have liked it.

推荐答案

帖子对象的文档没有提到喜欢的列表可能不完整,并且 fql流表的文档明确表示使用后置对象要获得完整的列表,所以这是API或文档中的错误。

The documentation of the post object doesn't mention that the likes list may be incomplete, and the documentation of the fql stream table explicitly says to use the post object to get the full list, so It's either a bug in the API or in the documentation.

我怀疑这可能是一个故意但不可取的功能来限制详细列出性能原因,因为一些帖子可能有数百甚至数千的喜欢。

I suspect it may be a deliberate but undesirable "feature" to limit the detailed list for performance reasons, as some posts may have hundreds or even thousands of likes.

最终导致巨大的性能问题,因为我需要找到所有的帖子被特定用户喜欢,唯一的方法是单独提取每个帖子的喜欢在列表中,其列表的数量高于列表长度。

It ends up actually causing a huge performance problem as I need to find all posts that have been liked by a particular user, and the only way to do that is to do a separate fetch of likes for each post in the list whose like count is higher than the like list length.

这篇关于帖子喜欢的数量和喜欢的数据之间的差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆