jQuery Instagram plugin redesign

The plugin uses the Instagram API to get a list of photos using the JSONP format, the original idea is by Daniel Pavitt.

Up to version 0.2 you could just make a call to

$('.selector').instagram({
  hash: 'boat',
  clientId: 'YOUR-CLIENT-ID'
});

to populate .selector element with a list of <div> elements containing photos from Instagram.

You couldn’t modify the generated code except using the onComplete callback, see issue #33.

Since version 0.3 I removed code generation and callbacks. Now code generation is up to the user and willLoadInstagram and didLoadInstagram events are triggered instead of using callbacks.

The didLoadInstagram event is triggered when Instagram API responds, the associated handler can access the whole response. Example:

$('.selector').on('didLoadInstagram', function(event, response) {
  console.log(response);
});

$('.selector').instagram({
  hash: 'boat',
  clientId: 'YOUR-CLIENT-ID'
});

You can find more examples at http://potomak.github.io/jquery-instagram/.

Moreover the plugin has been generated using grunt-init, it uses grunt as build system and includes tests made using the QUnit framework.

You can fork the project at http://github.com/potomak/jquery-instagram.

blog comments powered by Disqus