Я разрабатываю веб-сайт, для которого требуется фид 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>♥ {{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, сколько изображений нужно заглянуть.. в противном случае я полагаю, что значение по умолчанию равно нулю...
Я сделал мой: limit: '4'
будет довольно полезной частью информации, чтобы вставить в нее инструкции!
Смотри ниже:
<script type="text/javascript">
var feed = new Instafeed({
get: 'tagged',
tagName: 'cool',
clientId: '916c01b8624d43c7b4b76369aruc86a0',
limit: '4'
});
feed.run(); </script>