如何获得所有喜欢Facebook帖子的人? [英] How to get all people who liked Facebook post?

查看:83
本文介绍了如何获得所有喜欢Facebook帖子的人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有FB 帖子
我可以单击"77个人喜欢这个人",然后获取所有我需要的人.
问题:有没有办法通过FB API吸引这些人?
PS,我想从这些列表中获得3个随机名称,所以我需要让这些人使用JSON格式

I have FB post
I can click "77 people like this" and get all people I needed.
Question: is there way to get these people by FB API ?
PS I want to get 3 random names from these list so I need to have these people in JSON format

推荐答案

使用FQL很容易.这会为您提供三个喜欢此活动的人的随机ID

It's easy to do with FQL. This gets you three random ids of people who liked this event

SELECT user_id FROM like WHERE object_id = 336638873112346 ORDER BY rand() LIMIT 3

如果您想获取他们的名字,则可以这样重写查询:

If you wanted to get their names instead, you'd rewrite the query like this:

SELECT uid, name, username FROM user WHERE uid IN 
 (SELECT user_id FROM like WHERE object_id = 336638873112346 ORDER BY rand() LIMIT 3)

这篇关于如何获得所有喜欢Facebook帖子的人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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