如何访问外部网站的粉丝专页照片 [英] How to access Facebook Fan Page Photos within external Website

查看:84
本文介绍了如何访问外部网站的粉丝专页照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试利用Facebook照片托管,并允许我们的访问者通过我们的网页查看已上传到我们的粉丝墙的照片。

We are trying to utilize the facebook photo hosting and allow our visitors to view photos via our webpage that have been uploaded to our fan wall.

有谁知道如何这可以实现吗?

Does anyone know how this can be achieved?

提前感谢!
Steven。

Thank in advance! Steven.

推荐答案

使用社交图表,您可以执行此操作,前提是脚本具有访问令牌Facebook页面应用程序ID或您的照片权限设置为完全公开。

Using the social graph, you can do this, provided the script has an access token for your facebook page app ID or your photo permissions are set to be completely public.

使用社交图表,您可以通过REST类似的Web服务访问照片。 webservice调用将返回dataExample的JSON对象:

Using the social graph, you basically access the photos via a REST like web service. The webservice call will return a JSON object of dataExample:

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

(可口可乐粉丝专页的相簿)

(Photo albums for the Coca Cola fan page)

所以第一步是使用上面的URL检索相册。
遍历相册并获取所需相册的对象ID。

So the first step would be to retrieve the albums using a URL like the one above. Traverse through the photo albums and get the object ID of the album you want.

{
         "id": "455377148305",
         "from": {
            "name": "Coca-Cola",
            "category": "Company",
            "id": "40796308305"
         },
         "name": "Coca-Cola Fanmeile FIFA WM 2010",
         "link": "http://www.facebook.com/album.php?aid=249745&id=40796308305",
         "count": 20,
         "type": "normal",
         "created_time": "2010-10-22T15:53:36+0000",
         "updated_time": "2010-10-22T15:55:23+0000",
         "comments": {}
},

拥有对象ID后,只需将其作为图形URL的第一个参数即可访问它。例如:

Once you have the object ID, you can access it by simply placing it as the first paramter of the graph URL. E.g:

https://graph.facebook.com/40796308305

从那里,您应该能够抓取图像的实际URL(取决于权限设置)

From there, you should be able to grab the actual URL to the images (depending on permission settings)

{
   "id": "40796308305",
   "name": "Coca-Cola",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs236.ash2/50516_40796308305_7651_s.jpg",
   "link": "http://www.facebook.com/coca-cola",
   "category": "Company",
   "website": "http://www.coca-cola.com",
   "username": "coca-cola",
   "products": "Coca-Cola is the most popular and biggest-selling soft drink in history, as well as the best-known product in the world.\n\nCreated in Atlanta, Georgia, by Dr. John S. Pemberton, Coca-Cola was first offered as a fountain beverage by mixing Coca-Cola syrup with carbonated water. Coca-Cola was introduced in 1886, patented in 1887, registered as a trademark in 1893 and by 1895 it was being sold in every state and territory in the United States. In 1899, The Coca-Cola Company began franchised bottling operations in the United States.\n\nCoca-Cola might owe its origins to the United States, but its popularity has made it truly universal. Today, you can find Coca-Cola in virtually every part of the world.",
   "likes": 22264613
}

这篇关于如何访问外部网站的粉丝专页照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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