如何将 Facebook 相册集成到网站中?

How can I integrate Facebook photo album into website?(如何将 Facebook 相册集成到网站中?)
本文介绍了如何将 Facebook 相册集成到网站中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

可能的重复:
Facebook Api - 如何访问我的相册

如何在网站内显示 Facebook 相册中的照片?

How can I display photos from a Facebook album inside a website?

推荐答案

您可以使用图形 api 来获取相册中的图像,如下所示:https://graph.facebook.com/ALBUM_ID/photos您将获得一个包含该相册中所有图像的数组.该数组包含这样的对象:

You can use the graph api to get the images in an album, like this: https://graph.facebook.com/ALBUM_ID/photos You get an array containing all the images in that album. The array contains objects like this:

"name": "hopes you're having a great weekend!",
         "picture": "http://photos-d.ak.fbcdn.net/hphotos-ak-snc1/5370_127826373305_40796308305_2373079_2781005_s.jpg",
         "source": "http://a4.sphotos.ak.fbcdn.net/hphotos-ak-snc1/5370_127826373305_40796308305_2373079_2781005_n.jpg",
         "height": 604,
         "width": 427,
         "images": [
            {
               "height": 604,
               "width": 427,
               "source": "http://a4.sphotos.ak.fbcdn.net/hphotos-ak-snc1/5370_127826373305_40796308305_2373079_2781005_n.jpg"
            },
            {
               "height": 254,
               "width": 180,
               "source": "http://photos-d.ak.fbcdn.net/hphotos-ak-snc1/5370_127826373305_40796308305_2373079_2781005_a.jpg"
            },
            {
               "height": 130,
               "width": 91,
               "source": "http://photos-d.ak.fbcdn.net/hphotos-ak-snc1/5370_127826373305_40796308305_2373079_2781005_s.jpg"
            },
            {
               "height": 106,
               "width": 75,
               "source": "http://photos-d.ak.fbcdn.net/hphotos-ak-snc1/5370_127826373305_40796308305_2373079_2781005_t.jpg"
            }
         ],

这是 api 文档中的一个示例.您可以直接使用这些图片链接,Facebook 甚至会为您提供不同尺寸的图库.祝你好运.

This is an example from the api documentation. You can use these image links directly, facebook even gives you different sizes for the gallery. Good luck.

这篇关于如何将 Facebook 相册集成到网站中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to make 5 random numbers with sum of 100(如何制作5个总和为100的随机数)
str_shuffle and randomness(str_shuffle 和随机性)
Algorithm for generating a random number(生成随机数的算法)
What#39;s the disadvantage of mt_rand?(mt_rand 的缺点是什么?)
What is the best way to generate a random key within PHP?(在 PHP 中生成随机密钥的最佳方法是什么?)
How to create a random string using PHP?(如何使用 PHP 创建随机字符串?)