0
我正在嘗試使用Embedly生成給定網址的縮略圖。我需要縮略圖爲比最大尺寸更小,所以調用API像這樣:Embedly.oembed不遵守最大寬度參數
url = "http://embed.ly"
embedly_api = Embedly::API.new(key: ENV['EMBEDLY_KEY'])
obj = embedly_api.oembed(url: url, maxwidth: 50, type: 'photo').first
json_obj = JSON.pretty_generate(obj.marshal_dump)
或
http://api.embed.ly/1/oembed?key=[KEY_VALUE]&url=http://embed.ly&maxwidth=50&type=photo
在任一情況下,結果是:
{
provider_url: "http://embed.ly",
description: "Embedly delivers the ultra-fast,...",
title: "Embedly makes your content more engaging and easier...",
mean_alpha: 32.7480314961,
thumbnail_width: 399,
url: "http://embed.ly",
thumbnail_url: "http://embed.ly/static/images/logos/logo_color.png?v=4b245",
version: "1.0",
provider_name: "Embedly",
type: "link",
thumbnail_height: 127
}
通知thumbnail_width
是399(這比我通過的maxwidth
參數大)。我在這裏錯過了很明顯的東西嗎