如何在一页中显示 Facebook 的所有用户名和电子邮件?
明白了吗?是否有任何查询可以通过 Graph Api 从我的 Facebook 应用程序中提取所有用户姓名和电子邮件?
顺便说一句,我在电子邮件字段上拥有扩展授权;-)
这个想法是成对显示所有信息,例如...
姓名;电子邮件
你知道我在说什么吗 ;-) ?
干杯!
Got the idea? Is there any query to pull all users name and email from my Facebook APP via Graph Api?
BTW I have the extended authorization on email field ;-)
The idea is displaying all the info in pairs like...
Name ; Email
You know what I'm talking about ;-) ?
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上这很简单,但是首先您需要获得访问令牌。有关如何获取访问令牌的信息,请访问 http://developers.facebook.com/docs/ Reference/api
一旦获得该令牌,您就可以在图表中查询 id,并请求数据。以下是查询单个用户的调用的样子。
https://graph.facebook.com/user1&access_token=ACCESS_TOKEN_HERE
如果您愿意抓取多个用户,然后你可以使用 ids 参数,它会为你抓取所有这些记录。我认为最大值约为 25 个 ids iirc。这些是逗号分隔的。
https://graph.facebook.com/?ids=user1,user2&access_token =ACCESS_TOKEN_HERE
如果您想要更多信息,您还可以附加 &metadata=1 以获得每个节点返回的更多元数据。
https://graph.facebook.com/user1&metadata=1&access_token=ACCESS_TOKEN_HERE
一旦你进行调用,你将需要解析返回的 json 对象,但这应该是微不足道的。
希望这对您有帮助。
Actually it's pretty easy, however first you need to get an access token. For information on how to get an access token go to http://developers.facebook.com/docs/reference/api
Once you have that token, you can query the graph for id's, and ask for data. Here's what the call would look like to query a single user.
https://graph.facebook.com/user1&access_token=ACCESS_TOKEN_HERE
If you want to grab multiple users, then you can use the ids parameter and it will grab all those records for you. I think the max is around 25 ids iirc. These are comma delimited.
https://graph.facebook.com/?ids=user1,user2&access_token=ACCESS_TOKEN_HERE
If you want a bit more information you can also append &metadata=1 to get a lot more metadata returned with each node.
https://graph.facebook.com/user1&metadata=1&access_token=ACCESS_TOKEN_HERE
Once you make the call you will need to parse the json objects returned, but that should be trivial.
Hope this helps you out.