如何从 Facebook 粉丝页面获取相册

发布于 2024-12-22 10:12:05 字数 207 浏览 4 评论 0原文

我需要在我的 Facebook 粉丝页面上获取粉丝分享的所有照片。我能做什么?

我尝试使用 api graph,但我只看到我共享的相册。

https://graph.facebook.com/inpesca/albums/

I need get all photos shared by fans in my facebook page fan. I can do?

I try using api graph but I see only album shared by me.

https://graph.facebook.com/inpesca/albums/

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

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

发布评论

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

评论(1

傾城如夢未必闌珊 2024-12-29 10:12:05

您可以使用过滤器来获取墙上某些特定类型的帖子:

https://graph.facebook.com/inpesca/feed?type=checkin

请参阅 图形API参考

但是,您无法使用type=photo来获取照片帖子。无论出于何种原因,API 不支持此功能(可能是出于隐私原因;我不知道)。但是,提要上的每个帖子都有一个 type 字段,指示帖子的类型。您可以使用它来读取类型为“照片”的提要和过滤器帖子:

// pseudocode
posts = graph.get("/inpesca/feed")
for post in posts:
    if post.type == "photo":
        // process photo post
    else:
        // ignore it

要获取实际图片,请访问 图片 字段:

// psuedo code
url = post.picture // "https://fbcdn-photos-a.akamaihd.net/..."

如果您查看此指向的 URL,它很可能以 _s.jpg 结尾。这是图片的“小”版本。将其替换为 _o ,您将获得原始版本(据我所知,这没有记录,但似乎是它的工作原理)。如果您使用的是 Linux 或 Mac 计算机,则可以使用 curl 手动下载照片:

curl -O [url]

或者使用您的编程语言的 HTTP 客户端库来下载它。

You can use a filter to get at some specific types of posts on a wall:

https://graph.facebook.com/inpesca/feed?type=checkin

See "Searching" in the Graph API Reference.

However, you can not use type=photo to get photo posts. For whatever reason, the API doesn't support this (privacy reasons maybe; I don't know). However, each post on a feed has a type field, indicating the type of the post. You can use this to read the feed and filter posts that have type "photo":

// pseudocode
posts = graph.get("/inpesca/feed")
for post in posts:
    if post.type == "photo":
        // process photo post
    else:
        // ignore it

To get at the actual picture, access the picture field:

// psuedo code
url = post.picture // "https://fbcdn-photos-a.akamaihd.net/..."

If you look at the URL this points to, it most likely ends with _s.jpg. This is the "small" version of the picture. Replace it with _o and you will get the original version (as far as I can tell this is not documented, but seems to be how it works). You can manually download the photo with curl if you're on a Linux or Mac machine:

curl -O [url]

Or use your programming language's HTTP client library to download it.

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