使用Facebook API获取页面的所有照片 [英] Get all photos of a page using Facebook API

查看:168
本文介绍了使用Facebook API获取页面的所有照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Facebook的新手,但我必须从Facebook页面获取所有照片。我设法得到一个图形api查询,返回所有图片,只有 只是第一个创建的相册 ,该页面是个人资料相册。例如:

I am new to Facebook API but I have to get all photos from a Facebook page. I managed to get a graph api query that returns all pictures of only the first ever created album on the page which is the profile picture album. For example:

https://graph.facebook.com/227843870675663/photos

但是,我需要对页面中所有其他现有的相册执行相同操作。任何指针都非常感激。

But I need to do the same for all other existing albums in the page. Any pointers are really appreciated.

推荐答案

尝试这个,让我知道如何去做,我已经成功地拉出了所有照片。

try this and let me know how it goes for you, I've successfully pulled all photos.


  1. 确保您是Facebook页面的管理员。

  1. Ensure that you are an Admin of the Facebook Page.

go至:
http://developers.facebook.com/tools/explorer

在API导航器中,您可以看到/ me将显示您自己的基本信息。

In the API Navigator, you can see "/me" will bring up the basic information of yourself.

尝试输入/ me / accounts,看看是否可以看到任何内容。它应该给你一个错误。

Try typing in "/me/accounts" to see if you can see anything. It should give you an error.

点击获取访问令牌

将弹出一个窗口。导航到扩展权限

a window will pop-up. Navigate to "Extended Permissions"

选择manage_pages

点击获取访问令牌

现在尝试帐户。您应该在查看窗口中看到页面列表。

Now try "/me/accounts" again. You should see a list of Pages inside the viewing window.

选择所需的页面,然后点击id字段

Select the Page you want, and click on the "id" field

接下来,在左侧窗口中,您可以看到Node: + 标志。点击+号,看看你有什么选择。

Next, on the left window, you can see "Node: " and a + sign. Click on the + sign to see what are the options you have.

点击+号,向下滚动到连接,然后选择相册

Click on the + sign and scroll down to "connections" and select "Albums"

小孩级别选择照片

照片子级别,选择

现在点击 提交在右侧。你会看到一个JSON返回的所有照片的URL在您选择的Facebook页面。

Now click "Submit" on the right hand side. You will see a JSON returned with the url of all the photos in your selected Facebook Page.

复制URL - https://graph.facebook.com/ ?fields = albums.fields(photos.fields(source)),并将其插入浏览器。您应该看到所有照片的JSON及其在Facebook的CDN上的相应网址。

Copy the URL - https://graph.facebook.com/?fields=albums.fields(photos.fields(source)) and plug it into your browser. You should see a JSON of all your photos, and its corresponding url on Facebook's CDN.

这篇关于使用Facebook API获取页面的所有照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆