1

I would like my website to display all #awesome posted on Instagram and I am only getting the ones that I post. Can anyone help me fix this? Any help is much appreciated!

Side note: I don't really want #awesome I am protecting what I do want with something more generic!

<script type="text/javascript">
var count = 0;
var templateRowStart = '<div class="row">';
var templateRowEnd = '</div>';
var myTemplate = '<img class="insta" src=\"https:{{image}}\" />';
var myTemplateFirst = '<img class="insta first" src=\"https:{{image}}\" />';
var myTemplateLast = '<img class="insta last" src=\"https:{{image}}\" />';
var myTemplateTop = '<img class="insta top" src=\"https:{{image}}\" />';
var myTemplateBottomL = '<img class="insta bottomL" src=\"https:{{image}}\" />';
var myTemplateBottomR = '<img class="insta bottomR" src=\"https:{{image}}\" />';
var templateToUse = '';
var feed = new Instafeed({
get: 'tagged',
tagName: 'awesome',
clientId: '####',
accessToken: 'XXXX',
limit: '9',
resolution: 'standard_resolution',
each: function(){
  count++;
  if (/[4]/.test(count)){
    templateToUse = templateRowStart + myTemplate;
  } else if (/[6]/.test(count)) {
    templateToUse = myTemplate + templateRowEnd;
  } else if (/[1]/.test(count)) {
    templateToUse = templateRowStart + myTemplateFirst;
  } else if (/[9]/.test(count)) {
    templateToUse = myTemplateLast + templateRowEnd;
  } else if (/[2,8]/.test(count)) {
    templateToUse = myTemplateTop;
  } else if (/[3]/.test(count)) {
    templateToUse = myTemplateBottomL + templateRowEnd;;
  } else if (/[7]/.test(count)) {
    templateToUse = templateRowStart + myTemplateBottomR;
  } else {
    templateToUse = myTemplate;
  }
  this.options.template = templateToUse;
},
after: function() {
    // disable button if no more results to load
    if (!this.hasNext()) {
        loadButton.setAttribute('disabled', 'disabled');
    }
},
template: templateRowStart + myTemplate
});
feed.run();
</script>
  • 1
    Possible duplicate of [Take all photos from Instagram who have the specific hashtag with PHP](http://stackoverflow.com/questions/11182191/take-all-photos-from-instagram-who-have-the-specific-hashtag-with-php) or [Instagram API to fetch pictures with specific hashtags](http://stackoverflow.com/questions/13177428/instagram-api-to-fetch-pictures-with-specific-hashtags) – Ani Menon May 12 '16 at 14:32
  • It is similar, but I'm using instafeed.js which is all JavaScript and not PHP. Help with what I have is preferable but I will look into this because I can't seem to find help anywhere. Thank you! – Sarah Himmler May 12 '16 at 17:05
  • [Instafeed.js](https://github.com/stevenschobert/instafeed.js), this page has how to setup. Isn't this working? – Ani Menon May 12 '16 at 17:18
  • I can get it to work but I am looking to pull all '#awesome', not just the images I post with a '#awesome'. That is what I'm having problems with. – Sarah Himmler May 12 '16 at 17:23

0 Answers0