jQuery Instagram 的最大请求数是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12322028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the maximum number of requests for Instagram?
提问by TikaL13
I was wondering if there is a limitation of the number of images that are tagged that you can return?
我想知道您可以返回的标记图像数量是否有限制?
This is my code:
这是我的代码:
<script type="text/javascript">
$(function() {
$.ajax({
type:'GET',
dataType:'jsonp',
cache: false,
url:'https://api.instagram.com/v1/tags/[TAG NAME]/media/recent?client_id=[CLIENT ID]',
success: function(data) {
for (var i = 0; i < 50; i++) {
$(".pics").append("<li><a target='_blank' href='" + data.data[i].link +
"' class='upshot-instagram' rel='instagram-group'><img src='" + data.data[i].images.thumbnail.url +"' ></img></a></li>");
}
}
});
});
</script>
I have 50 returning but I am only getting 20 images coming back to me. I know we have over 250 that have been tagged.
我有 50 个返回,但我只收到 20 个图像返回给我。我知道我们有超过 250 个已被标记。
回答by tcd
The API will only return 20 images per call. This is where the pagination
data will come in handy, you can use the MAX_ID
provided by the Instagram API, read more here.
API 每次调用只会返回 20 张图像。这是pagination
数据将派上用场的地方,您可以使用MAX_ID
Instagram API 提供的,在此处阅读更多信息。
This is in PHP and jQuery, but it can help you get on the right track: load more example
这是在 PHP 和 jQuery 中的,但它可以帮助您走上正轨:加载更多示例
回答by d4nyll
The default number of items returned is 20. However, you can specify more using a count
parameter. At the time of this writing, it appears to be 33, but that could change as it is undocumented.
返回的默认项数为 20。但是,您可以使用count
参数指定更多项。在撰写本文时,它似乎是 33,但由于没有记录,这可能会改变。
So the answer to your question is - 33, but it can (and probably will) change.
所以你的问题的答案是 - 33,但它可以(并且可能会)改变。
To answer your problem, you can use Instafetch, a script I wrote, which will paginate and filter for you, and allows you to fetch as many pictures as you specify.
为了回答您的问题,您可以使用Instafetch,这是我编写的一个脚本,它将为您分页和过滤,并允许您获取指定数量的图片。