mam-project-templates
Version:
my personal templating projects
10 lines (9 loc) • 836 B
JavaScript
/*
* jQInstaPics
* Created by: Abid Din - http://craftedpixelz.co.uk
* Version: 1.0
* Copyright: Crafted Pixelz
* License: MIT license
* Updated: 26th April 2013
*/
(function(a){a.fn.jqinstapics=function(b){var c={user_id:null,access_token:null,count:10};var d=a.extend(c,b);return this.each(function(){var b=a(this),c="https://api.instagram.com/v1/users/"+d.user_id+"/media/recent?access_token="+d.access_token+"&count="+d.count+"&callback=?";a.getJSON(c,function(c){a.each(c.data,function(c,d){var e=a("<li/>").appendTo(b),f=a("<a/>",{href:d.link,target:"_blank"}).appendTo(e),g=a("<img/>",{src:d.images.thumbnail.url}).appendTo(f);if(d.caption){f.attr("title",d.caption.text)}})});if(d.user_id==null||d.access_token==null){b.append("<li>Please specify a User ID and Access Token, as outlined in the docs.</li>")}})}})(jQuery);