【发布时间】:2016-08-12 07:20:06
【问题描述】:
我正在使用此 URL 返回所有带有 yolo 标记的图像的计数: https://api.instagram.com/v1/tags/yolo?access_token=
还有返回图像 URL 及其元数据的方法吗?我似乎只能从与访问令牌相关的用户那里获取图像 URL。
我可以通过以下调用抓取 Instagram 来检索我需要的数据。如何将 .window._sharedData 提取为 json 对象?
var xhr = new XMLHttpRequest();
xhr.open('GET', "https://www.instagram.com/explore/tags/yolo/");
xhr.onload = function() {
if (xhr.status === 200) {
var result = xhr.responseText;
// .window._sharedData;
console.log(result);
// ('request successful ' + xhr.responseText.);
}
else {
console.log('request failed: ' + xhr.status);
}
};
xhr.send();
【问题讨论】:
标签: javascript api instagram