gpt4 book ai didi

javascript - Instafeed 脚本不工作

转载 作者:行者123 更新时间:2023-11-28 10:43:50 24 4
gpt4 key购买 nike

我一直在开发一个需要 Instagram 提要的网站。不幸的是,我无法让它工作!这是我所做的。

<script type="text/javascript">
feed = new Instafeed({
clientId: '99808b1edfc140eda1cfa2dca4b4fe4c',
accessToken: '201047212.467ede5.1072e8c882e34a8fb7975f725e7b3ba8',
get: 'user',
userId: 201047212,
resolution: 'standard_resolution',
links: 'false',
template: '<div id="instafeed-caption">{{caption}} <br>&hearts; {{likes}} on <a href="{{link}}" class="sky">instagram</a></div><div id="instafeed-container"><img src="{{image}}" /></div>',
mock: true,
custom: {
images: [],
currentImage: 0,
showImage: function () {
var result, image;
image = this.options.custom.images[this.options.custom.currentImage];
result = this._makeTemplate(this.options.template, {
model: image,
id: image.id,
link: image.link,
image: image.images[this.options.resolution].url,
caption: this._getObjectProperty(image, 'caption.text'),
likes: image.likes.count,
comments: image.comments.count,
location: this._getObjectProperty(image, 'location.name')
});
(function($){
$("#instafeed").html(result)
})
}
},
success: function (data) {
this.options.custom.images = data.data;
this.options.custom.showImage.call(this);
}
});
feed.run();

(function($){
$(".instafeed-next").click(function () {
var length, current;
current = feed.options.custom.currentImage;
length = feed.options.custom.images.length;
if (current < length - 1) {
feed.options.custom.currentImage++;
feed.options.custom.showImage.call(feed);
}
})
});

(function($){
$(".instafeed-prev").click(function () {
var length, current;
current = feed.options.custom.currentImage;
length = feed.options.custom.images.length;
if (current > 0) {
feed.options.custom.currentImage--
feed.options.custom.showImage.call(feed);
}
})
});
</script>

如果有人能告诉我脚本有什么问题,我将不胜感激。我在 Instafeed 网站上举了一个例子。作为引用,网站是www.hemeon.com .我的网站是www.vcluxe.nu/contact-me .谢谢!

最佳答案

哦嘿..我不知道你有多少代码......但 instafeed 页面似乎没有提到......是添加一个“限制”......这告诉 instagram 有多少图像加入...否则我认为默认值为零...

我做了我的:限制:'4'

将是一条非常有用的信息,可以放入说明中!

见下文:

 <script type="text/javascript">
var feed = new Instafeed({
get: 'tagged',
tagName: 'cool',
clientId: '916c01b8624d43c7b4b76369aruc86a0',
limit: '4'
});
feed.run(); </script>

关于javascript - Instafeed 脚本不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23060261/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com