使用组别名通过 Graph API 获取组对象?

发布于 12-03 15:59 字数 741 浏览 4 评论 0原文

如何使用组页面别名获取数据?

以此群组为例:http://www.facebook.com/groups/toroneradio/ 。 向 https://graph.facebook.com/toroneradio 发出请求会返回:

"message": "(#803) 您请求的某些别名不存在:toroneradio"

使用群组 ID 向图形 API 发出请求:https://graph.facebook.com/173246339390721 工作正常。

不过它对于页面来说效果很好。 查看了 FQL 组表,但名称不可搜索。 (FQL 组表) 还查找了一些文档并在 FB bugtracking 中找不到任何内容。

有没有办法以编程方式从组别名获取组 ID 或直接获取组图对象?

提前致谢!

How can i fetch data with group page alias ?

Take for example this group: http://www.facebook.com/groups/toroneradio/.
Making request to https://graph.facebook.com/toroneradio gives me back:

"message": "(#803) Some of the aliases you requested do not exist: toroneradio"

Making request to the graph API with the group's id: https://graph.facebook.com/173246339390721 works OK.

It works great for pages though.
Looked at FQL groups table but name is not searchable. (FQL Groups table)
Also looked for some documentation and in FB bugtracking, couldn't find anything.

Is there way to get programaticly the group id from group alias or directly to get Group graph object?

Thanks, in advance!

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

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

发布评论

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

评论(3

回忆凄美了谁2024-12-10 15:59:52

简单方法

  1. 如果您还没有这样做,请加入您想​​要获取群组 ID 的 Facebook 群组
  2. 使用 Facebook Graph API 浏览器
  3. 通过 http://graph.facebook.com/me 访问您的群组列表/groups
  4. 搜索群组,ID会出现列在对象中

如果您通过 Facebook 应用程序执行此操作,则只需在执行 FB Graph API 调用之前获取 FB 访问令牌即可 (阅读此处的文档,尤其是授权部分

困难的方法

如果简单的方法不起作用(或者如果您对加入该组感到犹豫) ,这是执行此操作的可靠方法:

  1. 启动 Firebug 并启用“网络”选项卡
  2. 启动 Facebook - 检查网络面板是否会显示正在发生的所有 HTTP 请求
  3. 单击“清除”按钮,以便面板处于空白状态
  4. 单击 Facebook 的链接您想要检索 Facebook ID 的组
  5. 留意对 generic.php 的 GET 请求 - 这将是第一个请求,但如果不是,则将其捕获。单击 [+] 框展开详细信息
  6. 单击“参数”选项卡,您将看到请求的键值字典。其中将有两个字段,称为“key”和“sk”,这两个字段都带有相同的值,如“group_1656399367890”。
  7. 组的 ID 将是“group_”后面的数值(在本例中,它将是1656399367890)

希望有帮助!

The Easy Way

  1. If you haven't done so, join the Facebook group which you want to fetch the group ID
  2. Use the Facebook Graph API explorer
  3. Access your list of groups via http://graph.facebook.com/me/groups
  4. Search for the group and the ID will be listed in the object

If you are doing it through your Facebook application, all you need is to grab an FB access token before you do the FB Graph API call (read up the documentation here, especially the Authorization section)

The Hard Way

In case the easy way doesn't work (or if you feel iffy in joining the group), here's the sure-fire way to do so:

  1. Start up Firebug and enable the "Net" tab
  2. Bring up Facebook - check that the Net panl will show all the HTTP requests that's happening
  3. Click the "Clear" button so that you have the panel in the blank slate
  4. Click on the link of the Facebook group that you wanted to retrieve the Facebook ID
  5. Look out for a GET request to generic.php - that would be the very first request, but hunt it down if it's not. Click on the [+] box to expand the details
  6. Click on the "Parameters" tab and you'd see a key-value dictionary of the request. There'll be two fields in there called "key" and "sk", both of which would carry the same value like "group_1656399367890"
  7. The group's ID will be the numeric value after "group_" (in this case, it'll be 1656399367890)

Hope that helps!

铁轨上的流浪者2024-12-10 15:59:52

通过使用 FQL:

SELECT id FROM profile WHERE username='groupname' AND type='group'

By using FQL:

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