如何使用 GraphAPI 从 Facebook 群组检索照片?
我想使用 GraphAPI 从 Facebook 群组检索照片。根据 FB 文档,我没有看到与照片的任何联系。我想获取照片和上传照片的用户。
I would like to retrieve photos from a facebook group using the GraphAPI. Based on FB Docs I don't see any connections to photos. I would like to get the photos and the users who uploaded them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我有同样的问题/这是我的部分答案,这仍然是一种黑客:
可以通过 FQL group.stream 或 GraphAPI group.feed 检索发布在组上的照片(使用 facebook graphApi explorer 或 fql 查询/多查询测试控制台)。
通过这种方式,您可以检索所有需要的信息,包括检索照片的有效 ID 和从图表中检索对象的有效 ID。
但是,这仅适用于单张照片。
由于我之前的答案已被删除,我不会在此处重新发布它,但请注意,此线程中详细介绍了我的类似问题 FQL 或 GraphAPI 无法检索在 GROUP 上发布的相册或视频,如果解决了该问题,可能会甚至还可以帮助人们解决这个问题。
托马斯
I have the same problem / here is my partial answer, which remains kind of hack :
one can retrieve photos posted on a group via the FQL group.stream or the GraphAPI group.feed (playing around with the facebook graphApi explorer or the fql query/multiquery test console).
This way you can retrieve all needed information, included a valid id to retrieve the photo, and one to retrieve the object from the graph.
BUT, this is only valid for individual photos.
since my previous answer was deleted, i won't repost it here, but remind that my similar problem is detailed in this thread FQL or GraphAPI unable to retrieve PHOTO ALBUM or VIDEO posted on a GROUP , which, if ever solved, might even as well help people for this very problem here.
Thomas
我不认为 R 组中的相册被视为个人资料页面上的相册。这些照片有援助=“0”,即使它们是专辑的一部分。
我使用了下面的图片:
https://www.facebook.com/photo.php?fbid =10151350034089218 是图片的链接。你可以猜到我从哪里得到了 object_ID。
在此示例中,10151350034089218 是我的群组“T_Group”相册中图像的 object_ID 该群组的链接为 https://www.facebook.com/groups/217697621700825/。
FQL 查询,
然后,您可以运行您将得到的
即使它是专辑“Hugh Laurie”的一部分。
我对我的个人资料相册中的图像尝试了相同的 FQL 查询,他们总是返回一些非 0 数字的帮助。
我计划在 Facebook 上发布错误,希望能得到修复。除非它按预期运行。
我尝试过:
...我得到了发布到群组页面的照片的 PID,而不是相册中的图像。
I don't think Albums in groups R treated like albums on Profile pages. The pics have aid ="0" Even if they are part of albums.
I used The Image below:
https://www.facebook.com/photo.php?fbid=10151350034089218 is the link to the image. And you can guess where I got the object_ID.
In this example 10151350034089218 is the object_ID for an image in an album for my group "T_Group" The link to the group is https://www.facebook.com/groups/217697621700825/.
You can then run the FQL query
you'll get
Even though it is part of an album "Hugh Laurie".
I tried the same FQL query with images in albums on my profile and they always returned an aid with some Number other than 0.
I plan on posting to Facebook bugs, I hope I get a fix. Unless its running as intended.
I tried:
...and I got PIDs to photos posted to the group page not images in albums.
我希望我找到了一种更直接的方法,但这似乎有希望:
get /me/groups 或 /me?fields=groups 来获取组 id。
由此, get {group_id}/feed?type=photo 这仅返回 feed 中的照片,但您真正获得的(实现此目标)只是照片的 id(以 object_id 形式返回)。
然后,对于每张照片,您可以获得 /{object_id} ,它返回各种尺寸图像的所有链接。
我在 Facebook Graph Explorer 中进行了这项研究,因此在尝试实现它时请记住这一点。
抢
I wish I had found a more direct method, but this appears to have promise:
get /me/groups or /me?fields=groups to get the groups ids.
From that, get {group_id}/feed?type=photo This returns just the photos from the feed, but all you really get (toward this goal) is the photo's id (returned as object_id).
Then for each photo you can get /{object_id} which returns all the links to the various sizes of the image.
I did this research in Facebook Graph Explorer, so keep that in mind as you try to implement it.
Rob
图 API:
http://graph.facebook.com/GROUP_ID/?fields=name,description ,相册
返回
并下一个查询
http://graph .facebook.com/GROUP_ALBUM_ID/photos?fields=图片、来源、名称&类型=上传
Graph API:
http://graph.facebook.com/GROUP_ID/?fields=name,description,albums
return
and next query
http://graph.facebook.com/GROUP_ALBUM_ID/photos?fields=picture,source,name&type=uploaded
我一直在研究同一个问题。
我们有一个团体相册,其网址为
https://www.facebook。 com/media/set/?set=oa.10150651435446985
所以 ID 似乎是 oa.10150651435446985
另一个空相册获取相册获取 set-id oa.10150652583791985
同一组中的一条笔记 id 10150652589396985
请注意以下相似之处身份证。
直接链接:http://facebook.com/10150651435446985 可转到相册。
该相册由用户 1128233556 创建,groupid 为 184760601984。
其他个人(不在相册中)集体照片位于“set”o.184760601984 中,其中数字代表组 id。
那么“o”和“oa”代表什么? a=专辑,o=?
图片具有以下 URL:https://fbcdn-sphotos -a.akamaihd.net/hphotos-ak-ash4/s720x720/420015_3293876662264_1128233556_33234982_110700674_n.jpg
谁能用这些制作一些东西?
Ive been digging a bit in the same issue.
We have a group album which is has this url
https://www.facebook.com/media/set/?set=oa.10150651435446985
So the ID seems to be oa.10150651435446985
Another empty album gets album gets the set-id oa.10150652583791985
A note in the same group id 10150652589396985
Notice the similarity in ID's.
The direct link: http://facebook.com/10150651435446985 works to go to the album.
The album is created by user 1128233556 and the groupid is 184760601984.
Other, individual (not in an album) group photos are in "set" o.184760601984 where the digit represents the group id.
So what does "o" and "oa" stand for? a=album, o=?
Pictures have the following URL: https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s720x720/420015_3293876662264_1128233556_33234982_110700674_n.jpg
Who can make something out of al that?