Facebook 图表显示活动参加者

发布于 2024-12-25 07:36:08 字数 365 浏览 1 评论 0 原文

我希望在 PHP 页面上显示给定 Facebook 活动的与会者。理想情况下,它应该是带有人物图片的图形显示。

我相信这可以使用 facebook graph API 来完成,但以下给出了一个需要签名的错误:

https://api.facebook.com/method/fql.query?query=SELECT uid FROM event_member WHERE eid =  ... AND rsvp_status = 'attending'

另外,我如何获得 eid?是否可以简单地从事件页面链接的末尾解析它? www.facebook.com/events/...eid#...

谢谢大家!

I am looking to display the attendees for a given facebook event on a PHP page. Ideally it would be that graphical display with people's pictures displaying.

I believe this could be done using the facebook graph API, but the following is giving me an error requiring signature:

https://api.facebook.com/method/fql.query?query=SELECT uid FROM event_member WHERE eid =  ... AND rsvp_status = 'attending'

Also, how would I even get the eid? Can it simply be parsed off the end of an event page link?
www.facebook.com/events/...eid#...

Thanks everybody!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单身狗的梦 2025-01-01 07:36:08

要获取活动参加者,您可以运行以下 FQL 查询:

SELECT uid FROM event_member WHERE eid = "EXISTING_EVENT_ID"

您可以获得活动 id来自许多来源,如果您通过 Graph API 创建事件,您将获得事件 id回复。或者您可以获得当前/特定用户参加的活动的 ID。或者正如您已经从活动页面的 URL 中注意到的那样。

下一个 FQL 查询将返回当前用户正在参加的所有活动:

SELECT eid FROM event_member WHERE uid = me() AND rsvp_status = "attending"

查询可以嵌套,以便您可以执行诸如获取当前用户曾经参加过的所有活动的所有参加者列表之类的操作:

SELECT eid, uid FROM event_member WHERE eid IN (
  SELECT eid FROM event_member WHERE uid = me() AND rsvp_status = "attending"
)

要获取特定活动的参加者详细信息,类似这样的操作可能会起作用:

SELECT uid, name, pic_square FROM user WHERE uid IN (
  SELECT uid FROM event_member WHERE eid = "EXISTING_EVENT_ID"
)

注意

  • 您需要任何有效的 access_token 才能获取公共活动详细信息。
  • 要检索当前用户的事件,您需要该用户向您的应用程序授予 user_events 权限。
  • 您可以仅通过 http://graph.facebook.com/{USER_ID}/picture 格式的 URL 显示用户图像,只需知道他的 id
  • 您可以通过发出 使用 Graph API 运行 FQL 查询GET 请求到 https://graph.facebook.com/fql?q={QUERY_HERE}

有关 FQLGraph API 阅读文档,尤其是在表 event_member用户

To get event attendees you can run following FQL query:

SELECT uid FROM event_member WHERE eid = "EXISTING_EVENT_ID"

Event id is something you can get from many sources, if you create event via Graph API you'll get event id as response. Or you can get ids of events current/specific user attending. Or as you already noted from URL of event page.

Next FQL query will return all events current user is attending:

SELECT eid FROM event_member WHERE uid = me() AND rsvp_status = "attending"

Queries can be nested so you can do stuff like get list of all attendees of all events current user ever attended:

SELECT eid, uid FROM event_member WHERE eid IN (
  SELECT eid FROM event_member WHERE uid = me() AND rsvp_status = "attending"
)

To get details of attendees for specific event something like this may do the work:

SELECT uid, name, pic_square FROM user WHERE uid IN (
  SELECT uid FROM event_member WHERE eid = "EXISTING_EVENT_ID"
)

NOTES:

  • You'll need any valid access_token to get public events details.
  • To retrieve events of current user you'll need user_events permission to be granted to your application by this user.
  • You can display user image with only knowing his id with URL in format of http://graph.facebook.com/{USER_ID}/picture
  • You can run FQL queries with Graph API by issuing GET request to https://graph.facebook.com/fql?q={QUERY_HERE}

For more details on FQL and Graph API read documentation, especially on tables event_member and user

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文