【发布时间】:2016-06-29 06:36:46
【问题描述】:
是否可以使用以下 URL 未经授权从 Instagram 获取用户的媒体供稿并控制呈现的数据?
https://www.instagram.com/{username}/media/
响应带有 JSON 格式:
{
status: "ok",
items: [
{
can_delete_comments: false,
code: "BHN55zegQYk",
location: null,
images: {
low_resolution: {
url: "https://scontent-waw1-1.cdninstagram.com/t51.2885-15/s320x320/e35/13551611_1746490512297913_1853324944_n.jpg?ig_cache_key=MTI4MjkzNjEyOTgwNDM3MTQ5Mg%3D%3D.2.l",
width: 320,
height: 320
},
thumbnail: {
url: "https://scontent-waw1-1.cdninstagram.com/t51.2885-15/s150x150/e35/c0.0.1079.1079/13534565_996407620456445_1170595894_n.jpg?ig_cache_key=MTI4MjkzNjEyOTgwNDM3MTQ5Mg%3D%3D.2.c",
width: 150,
height: 150
},
standard_resolution: {
url: "https://scontent-waw1-1.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/13551611_1746490512297913_1853324944_n.jpg?ig_cache_key=MTI4MjkzNjEyOTgwNDM3MTQ5Mg%3D%3D.2.l",
width: 640,
height: 640
}
},
can_view_comments: true,
comments: {
count: 2,
data: [
{
created_time: "1467158133",
text: "#flowermuse #peonyseason #peonies #peonylove",
from: { /* user object */ },
id: "17848900168109698"
},
{
created_time: "1467171168",
text: "????!!",
from: { /* user object */ },
id: "17848905430109698"
}
]
},
alt_media_url: null,
caption: {
created_time: "1467157926",
text: "The first of Alaskan peonies going out this week! ????",
from: { /* user object */ },
id: "17848900084109698"
},
link: "https://www.instagram.com/p/BHN55zegQYk/",
likes: {
count: 156,
data: [
{ /* user object */ },
{ /* user object */ },
{ /* user object */ },
{ /* user object */ }
]
},
created_time: "1467157926",
user_has_liked: false,
type: "image",
id: "1282936129804371492_25920898",
user: { /* user object */ }
},
{ /* more media objects */ }
]
}
是否有可能以某种方式过滤这些数据?例如,我只需要返回项目的images 部分,我可以轻松跳过user 数据、他们的 cmets、like 等。
我想将获取的数据限制在图像源及其描述中。
【问题讨论】:
标签: json rest instagram instagram-api