New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 () #398

Closed
qLb opened this Issue Apr 15, 2016 · 7 comments

Comments

5 participants
@qLb

qLb commented Apr 15, 2016

I tried to add a gallery for one of my friend's sites but it failed...
this is the console output:
https://api.instagram.com/v1/media/popular?client_id=91474e03ddfd483eb403831b8b395c17&count=12&callback=instafeedCache8c2d1b8ce02f76b1.parse 404 ()

my full code:

var feed = new Instafeed({
  clientId: '91474e03ddfd483eb403831b8b395c17', //qlbio
  limit: 12,
  sortBy: 'most-liked',
  resolution: 'standard_resolution',
  after: function () {
    var images = $("#instafeed").find('a');
    $.each(images, function(index, image) {
      var delay = (index * 75) + 'ms';
      $(image).css('-webkit-animation-delay', delay);
      $(image).css('-moz-animation-delay', delay);
      $(image).css('-ms-animation-delay', delay);
      $(image).css('-o-animation-delay', delay);
      $(image).css('animation-delay', delay);
      $(image).addClass('animated flipInX');
    });
  },
  template: '<div class="image-box" style="background: url({{image}});background-size:120%;background-position:center center;"><a class="image fit" href="{{link}}" target="_blank"><div class="likes">&hearts; {{likes}}</div></a></div>'
});
feed.run();

any ideas where i made a mistake?

@peterholcomb

This comment has been minimized.

peterholcomb commented Apr 18, 2016

In the same boat as you. Also getting a 404 returned from api.instagram.com

@RyabokonRoman

This comment has been minimized.

RyabokonRoman commented Apr 20, 2016

+1

@qLb

This comment has been minimized.

qLb commented Apr 20, 2016

Fix:

Right at: http://instagram.com/developer
Log in
Click on Manage Clients
Register a New Client

Fill the form
Make SURE to set the OAuth redirect_uri field to http://localhost
Also, make sure to uncheck the Disable implicit OAuth box or else this method will not work
Find out your instagram user id: http://jelled.com/instagram/lookup-user-id
And finally, paste the following url into your web browser (UPPERCASE strings should be typed in by YOU :)
https://instagram.com/oauth/authorize/?client_id=[YOUR_CLIENT_ID]&redirect_uri=http://localhost&response_type=token

now inside your instafeed configuration:

  ...
  clientId: 'YOUR_CLIENT_ID',
  get: 'user',
  userId: 'YOUR_USER_ID',
  accessToken: 'YOUR_ACCESS_TOKEN',
  ...

Be advised that storing your accessToken in client side scripts is VERY DANGEROUS, i strongly suggest using something like https://www.firebase.com/ for storing your secret and then making the database available only to a specific domain (NOT localhost :)

good luck
qL.b

@qLb

This comment has been minimized.

qLb commented Apr 20, 2016

ps. There is ofcourse a limit for sandbox clients (500 requests/hour) and for approved clients (5000 requests/hour)
pps. sandbox clients do not have access to public data like popular, newest etc, etc..
https://api.instagram.com/v1/media/popular?

@MeK-KeM

This comment has been minimized.

MeK-KeM commented Jun 27, 2018

Look here: #571

@davide77

This comment has been minimized.

davide77 commented Jul 24, 2018

Just get the access token here http://instagram.pixelunion.net/

@stale

This comment has been minimized.

stale bot commented Oct 23, 2018

This issue has been automatically marked as stale because it hasn't had new comments in the last 3 months. It will be closed if no further activity occurs. If you still need assistance with this issue, or believe it shouldn't be closed, please respond with a new comment to let us know.
Thank you all for your contributions.

@stale stale bot added the stale label Oct 23, 2018

@stale stale bot closed this Oct 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment