【发布时间】:2015-12-05 07:17:06
【问题描述】:
有很多关于如何创建应用程序和使用 OAuth 授权应用程序用户访问 Instagram 的文档……但我没有第三方用户。我只想编写对 API 的访问以获取数据,就像使用 Twitter 或 Reddit 一样。
我是否遗漏了一些明显的东西?
【问题讨论】:
有很多关于如何创建应用程序和使用 OAuth 授权应用程序用户访问 Instagram 的文档……但我没有第三方用户。我只想编写对 API 的访问以获取数据,就像使用 Twitter 或 Reddit 一样。
我是否遗漏了一些明显的东西?
【问题讨论】:
你可以这样使用。在这里,我从主题标签中获取所有数据。 访问link 了解更多信息。
$(document).ready(function () {
var hashtag = 'dilwale'// My hash tag
var accessToken = '16741082.1b07669.121a338d0cbe4ff6a5e04543158a4f82' //Write your access token
$.ajax({
url: 'https://api.instagram.com/v1/tags/' + hashtag + '/media/recent?count=33&access_token='+ accessToken +'',
dataType: 'jsonp',
type: 'GET',
success: function (data) {
console.log(data);
for (x in data.data) {
if (data.data[x].type == 'video') {
//console.log("Video" + data.data[x].videos.standard_resolution.url);
//See the browser console and add data as per requirements
$('.instagram').append('<div style="border:1px solid orange"><video controls><source src="' + data.data[x].videos.standard_resolution.url + '" type="video/mp4"></video><span style="border:1px solid orange; dislay:block">Test1</span></div>');
} else if (data.data[x].type == 'image') {
$('.instagram').append('<div style="border:1px solid orange"><img src="' + data.data[x].images.standard_resolution.url + '" ><span style="border:1px solid orange; display:block">"' + data.data[x].caption.text + '"</span><span style="border:1px solid orange; dislay:block">Test1</span></div>');
//console.log("Image");
//See the browser console and add data as per requirements
}
}
},
error: function (data) {
console.log(data);
}
})
});
在小提琴Get latest images and videosfrom a hash tag中寻找解决方案
【讨论】: