1

I'm using Instafeed.js for a client's site: http://instafeedjs.com/

I've included the script, got my access token & userID. I obtained these by scrolling down to the 'Getting images from your User Account' section of the aforementioned page, and clicking the link at bottom: Don't know your user id or token? Click here to get one.

My code:

$(document).ready(function() {
      var userFeed = new Instafeed({
           get: 'user',
           userId: clientsID,
           accessToken: 'MY_ACCESS_TOKEN',
           template: '<a href="{{link}}"><img src="{{image}}" /></a>',
           target: 'instafeed',
           limit: 6
       });
  userFeed.run();
 });

I've created an empty div with the 'instafeed' id. The div is being populated with 6 empty a tags, each with an empty image tag. I don't have any console errors.

In the instructions on this site, I'm told to

"make sure your token is set to basic authorization, which only allows GET requests. If you aren't sure what scope your token has, check under your account page."

On my account page, I have an 'Instafeed.js' application set up, but the only option I have is to revoke access. I cannot edit or see any other options, so I'm not sure if this could be related to the problem.

Any help would be greatly appreciated!

4 Answers 4

2

All tokens issues by the API are given the basic scope, unless the scope was specified in the authentication request.

From the Instagram API Docs:

Currently, all apps have basic read access by default. If all you want to do is access data then you do not need to specify a scope (the “basic” scope will be granted automatically).

You can verify which scope the token has by visiting the Manage Applications page. Each application will display what kind of access level it has. A basic permission set should say something like "Access your basic information":

So you shouldn't need to do anything to set the token's permissions, that's all handled when the token is created. If you used the helper link on instafeedjs.com to get that token, then all the permission levels should already be taken care of for you.

1

In case someone else runs into this issue, my problem was actually a conflict with Shopify's template engine. When I removed the template option everything worked fine, thanks to Steven here who actually responded to my email! This dude is killer.

3
  • How do you remove template options?
    – nick
    Oct 6, 2014 at 18:08
  • 1
    You just don't pass it as an option. When I removed the line 'template: '<a href="{{link}}"><img src="{{image}}" /></a>',' it worked just fine. In that case you don't have control to customize the containers around each image, but it already just gives you an image in an anchor tag anyways so that line is pretty much useless in practice. Oct 6, 2014 at 21:28
  • Ohhhhhhhh the template option on the plugin itself i thought you ment somewhere in shopify thanks so much!
    – nick
    Oct 6, 2014 at 21:44
0

In Shopify, if you drop the configuration script into a new "asset" labeled instafeed_config.js and then call it with

{{ "instafeed_config.js" | asset_url | script_tag }}

after loading

{{ "instafeed.min.js" | asset_url | script_tag }}

then you are able to use the Template feature.

-1

You can adjust the template section.

Change the following:

img src="{{image}}"

To:

img src="http:{{image}}"
3
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
    – pinepain
    Jul 9, 2014 at 12:51
  • @zaq178miami why not? It's suggesting a possible fix. Maybe not written in a perfect way, but after an edit it's a totally valid answer. Jul 9, 2014 at 13:11
  • Agreed - making this change to the template file is kind of a hack of a solution and might end up causing more problems than you started with Jul 9, 2014 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.