gpt4 book ai didi

json - Pinterest API 图像大小

转载 作者:行者123 更新时间:2023-12-03 16:46:04 25 4
gpt4 key购买 nike

根据几篇博文和 development site v3 API 仅部分可用(并且几乎没有文档记录)。我在 this article 中找到了我需要的端点:https://api.pinterest.com/v3/pidgets/boards/{用户名}/{board}/pins/它返回这样的引脚:

{
"attribution": {
"title": "Blue",
"url": "http://500px.com/photo/8371303",
"provider_icon_url": "http://passets-ak.pinterest.com/images/api/attrib/fivehundredpx@2x.png",
"author_name": "Eddie Chui",
"provider_favicon_url": "http://passets-ec.pinterest.com/images/api/attrib/fivehundredpx.png",
"author_url": "http://500px.com/EddieChui",
"provider_name": "fivehundredpx"
},
"description": "Khiva Uzbekistan",
"pinner": {
"image_small_url": "http://media-cache-ec0.pinimg.com/avatars/iweczek-1349184554_30.jpg",
"profile_url": "http://www.pinterest.com/highquality/",
"full_name": "A B"
},
"dominant_color": "#434744",
"link": "http://500px.com/photo/8371303",
"images": {
"237x": {
"url": "http://media-cache-ak0.pinimg.com/237x/b4/14/66/b414661df939392b2f0425e394be83db.jpg",
"width": 237,
"height": 359
}
},
"is_video": false,
"id": "159596380518659971"
}

根据domain api docs可以通过提供以下内容来指定您希望接收的图像尺寸:pin.images=[64x64,75x75,1200x]

知道这对于指定端点是否可行吗?如果是,我如何将其包含在请求中?

最佳答案

您可以通过使用 API 获得 237x 大小,然后将其替换为 url 中的“originals”来获得更大的图像

 $.ajax({
type: "GET",
dataType: "jsonp",
url: "https://api.pinterest.com/v3/pidgets/boards/vicemag/magazine/pins/" ,
success: function(data) {
var npins = data.data.pins.length
for (var i = 0; i < npins; i++) {
var a = data.data.pins[i].images["237x"].url,
a = a.replace('237x','originals')
}
}
});

关于json - Pinterest API 图像大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20612652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com