在 Facebook 图形 API 中如何找到您所有的朋友喜欢特定的书籍或电影
我正在尝试找出如何找到有多少朋友喜欢某个特定实体。
例如,对于给定的书籍或电影,我如何查找有多少朋友已经喜欢同一本书或电影。
我相信当我们显示 fb:like 按钮社交插件时,信息确实会出现,但我想获得该计数,以便我可以以编程方式显示我的朋友中最流行的书籍等(按降序排列)。
我的后端是 php,但我也使用 Javascript SDK。 感谢您提前提供的意见
I'm trying to figure out how to find how many of my friends like a particular entity.
For example, for a given book or movie, how can I look up how many of my friends have already liked the same book or movie.
I believe that information does appear when we display the fb:like button social plugin but I want to get that count so I can programatically display the most popular books among my friends etc is descending order.
My backend is php but I'm also using Javascript SDK.
Thanks for your inputs in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些“对象”实际上是页面,因此要检索您的好友列表,例如电影或书籍(页面),请使用以下查询:
在 fql.query,它将检索您所有喜欢 Inception 电影的好友 ID。
编辑:
检索您的朋友喜欢的电影(例如)的明显方法是:
但我注意到,如果集合很大(最有可能是这种情况),它不会返回所有用户对于每个用户)..所以我做了一个黑客只是为了让你开始!
这段代码正在执行以下操作:
好友 结果将是这样的:
从这里,您可以检查最喜欢的...等
PS:正如我所说的上面只是为了让您开始,我想您可以缓存一些查询并提高性能。< /em>
These "objects" are actually pages, so to retrieve your friends list that like a movie or a book (a page), use this query:
Try this in the console of fql.query, it will retrieve all your friends ID that likes the Inception movie.
EDIT:
The obvious way to retrieve the movies (for example) that your friends like would be:
But I've noticed that it won't return all the users if the set is large (which most likely the case for every user)..so I've made a hack just to get you started!
This code is doing the following:
And the result would be something like:
From here, you can check for the most liked...etc
P.S.: As I said the above just to get you started and I guess you can cache some queries and improve the performance.