Facebook rss - 如何增加大拇指图片大小? [英] facebook rss - how to increase thumbs image size?

查看:155
本文介绍了Facebook rss - 如何增加大拇指图片大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过

  http://www.facebook.com/feeds/page访问facebook-rss。 php?format = rss20& id = ... 

更新:网址:

  http://www.facebook.com/feeds/page.php?format=rss20&id=170589069647190 

然而,图像的拇指是小的。是否可以使用rss-arg或FB页面设置来更改滚筒的大小?



(或者我应该以另一种方式获取FB文章) p>

敬意,

解决方案

您应该使用 Facebook Graph API ,它更加强大,多功能,更好地维护。


  1. / PAGE_ID / feed 端点开始,所以在你的例子中 / 170589069647190 /进料。 (在浏览器中进行测试)很好,现在你有相同的帖子列表那个RSS提要。请注意,每张具有照片的帖子都有一个 object_id 字段。

  2. 对于每个 object_id ,转到端点 / OBJECT_ID?fields =图像,高度,宽度,源。如果您正在执行其中的多个操作,最好将它们批处理效率

这两个简单的步骤将为每张照片状态更新提供这些数据。外部高度宽度是原始上传尺寸和来源。但是,图像数组为您提供了一堆调整大小的图像。选择最符合您需求的一种。

  {
图像:[
{
height:2048,
width:1365,
source:https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s2048x2048/599910_508618522510908_1608434210_n.jpg
},
{
height:960,
width:640,
source:https://sphotos-b.xx .fbcdn.net / hphotos-snc7 / 599910_508618522510908_1608434210_n.jpg
},
{
height:720,
width:480,
source :https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s720x720/599910_508618522510908_1608434210_n.jpg
},
{
height:600,
width:400,
source:https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s600x600/599910_508618522510908_1608434210_n.jpg
},
{
height:480,
width:320,
source:https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s480x48 0 / 599910_508618522510908_1608434210_n.jpg
},
{
height:320,
width:213,
source:https:// sphotos-b.xx.fbcdn.net/hphotos-snc7/s320x320/599910_508618522510908_1608434210_n.jpg
},
{
height:270,
width:180 ,
source:https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/599910_508618522510908_1608434210_a.jpg
},
{
高度:130,
width:86,
source:https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/599910_508618522510908_1608434210_s.jpg
},
{
height:130,
width:86,
source:https://fbcdn-photos-a.akamaihd。 net / hphotos-ak-snc7 / s75x225 / 599910_508618522510908_1608434210_s.jpg
}
],
height:720,
width:480,
来源:https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s720x720/599910_508618522510908_1608434210_n.jpg,
id:508618522510908,
created_time:2013-03-04T11:05:09 + 0000
}
pre>

注意:为了快速执行此操作,您需要一个应用程序访问令牌


I'm accessing a facebook-rss through

http://www.facebook.com/feeds/page.php?format=rss20&id=...

Update: Actual URL:

http://www.facebook.com/feeds/page.php?format=rss20&id=170589069647190

However, the thumbs for the images are way to small. Is it possible to change the size of the tumbs with rss-arg or FB-page setting?

(or should I get the FB-posts in another way)

regards,

解决方案

You should use the Facebook Graph API for this, it's far more robust, versatile, and better maintained.

  1. Start at the /PAGE_ID/feed endpoint, so in your example /170589069647190/feed. (Play around in the explorer to test it) Great, now you have the same list of posts as that RSS feed. Note that each post with a photo has an object_id field.
  2. For each object_id, go to the endpoint /OBJECT_ID?fields=images,height,width,source. If you're doing multiple of them, it's best to batch them together for efficiency

Those 2 simple steps will give you this data for each photo status update. The outside height,width and source are the orginial upload dimensions and source. But the images array provides you with a bunch of resized images. Choose the one most appropriate for your needs.

{
  "images": [
    {
      "height": 2048, 
      "width": 1365, 
      "source": "https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s2048x2048/599910_508618522510908_1608434210_n.jpg"
    }, 
    {
      "height": 960, 
      "width": 640, 
      "source": "https://sphotos-b.xx.fbcdn.net/hphotos-snc7/599910_508618522510908_1608434210_n.jpg"
    }, 
    {
      "height": 720, 
      "width": 480, 
      "source": "https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s720x720/599910_508618522510908_1608434210_n.jpg"
    }, 
    {
      "height": 600, 
      "width": 400, 
      "source": "https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s600x600/599910_508618522510908_1608434210_n.jpg"
    }, 
    {
      "height": 480, 
      "width": 320, 
      "source": "https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s480x480/599910_508618522510908_1608434210_n.jpg"
    }, 
    {
      "height": 320, 
      "width": 213, 
      "source": "https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s320x320/599910_508618522510908_1608434210_n.jpg"
    }, 
    {
      "height": 270, 
      "width": 180, 
      "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/599910_508618522510908_1608434210_a.jpg"
    }, 
    {
      "height": 130, 
      "width": 86, 
      "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/599910_508618522510908_1608434210_s.jpg"
    }, 
    {
      "height": 130, 
      "width": 86, 
      "source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/s75x225/599910_508618522510908_1608434210_s.jpg"
    }
  ], 
  "height": 720, 
  "width": 480, 
  "source": "https://sphotos-b.xx.fbcdn.net/hphotos-snc7/s720x720/599910_508618522510908_1608434210_n.jpg", 
  "id": "508618522510908", 
  "created_time": "2013-03-04T11:05:09+0000"
}

NOTE: In order to do this on the fly, you'll need to a App Access Token.

这篇关于Facebook rss - 如何增加大拇指图片大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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