如何获取Instagram帖子的媒体ID?

时间:2015-08-03 07:16:40

标签: android instagram

由于/***** 3. proc means (not quite there) *****/ * proc means + ODS -> cannot recognize date formats; proc means data=have2 nonobs min max; class name company; format date yymms7.; * in vain; var date; run; 不允许使用API​​端点发布照片,因此我使用来自其他应用的Android InstagramInstagram应用上共享照片。如何获取共享帖子的媒体ID?

我们可以使用隐藏的intent来识别该特定帖子吗?

1 个答案:

答案 0 :(得分:0)

如果您想从可共享链接获取媒体ID,可以转到此链接。它会响应JSON。

http://api.instagram.com/oembed?url=https://instagram.com/p/6GgFE9JKzm/

响应:

unbuffer SOME COMMANDS  > OUT1.out &
unbuffer SOME_OTHER_COMMAND > OUT2.out &
tail -q -f OUT1.out -f OUT2.out --pid $!
wait

因此,您将获得media_id项目。

连接和解析json的代码:

{
"provider_url": "https://instagram.com/",
"media_id": "1046665049816739046_489992346",
"author_name": "8crap",
"height": null,
"provider_name": "Instagram",
"title": "Just as the goal in life is to work the least and get paid the most. #8crap",
"html": "<blockquote class=\"instagram-media\" data-instgrm-captioned data-instgrm-version=\"4\" style=\" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);\"><div style=\"padding:8px;\"> <div style=\" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;\"> <div style=\" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;\"></div></div> <p style=\" margin:8px 0 0 0; padding:0 4px;\"> <a href=\"https://instagram.com/p/6GgFE9JKzm/\" style=\" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;\" target=\"_top\">Just as the goal in life is to work the least and get paid the most. #8crap</a></p> <p style=\" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;\">8crap (@8crap) tarafından paylaşılan bir fotoğraf (<time style=\" font-family:Arial,sans-serif; font-size:14px; line-height:17px;\" datetime=\"2015-08-08T00:03:38+00:00\">7 Ağu 2015, 17:03 PDT</time>)</p></div></blockquote>\n<script async defer src=\"//platform.instagram.com/en_US/embeds.js\"></script>",
"width": 658,
"version": "1.0",
"author_url": "https://instagram.com/8crap",
"author_id": 489992346,
"type": "rich"
}
相关问题