{"action":"created","issue":{"url":"https://api.github.com/repos/michael-lynch/instagram-lite/issues/5","labels_url":"https://api.github.com/repos/michael-lynch/instagram-lite/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/michael-lynch/instagram-lite/issues/5/comments","events_url":"https://api.github.com/repos/michael-lynch/instagram-lite/issues/5/events","html_url":"https://github.com/michael-lynch/instagram-lite/issues/5","id":58777888,"number":5,"title":"Returns http from cdn image. I need https.","user":{"login":"avmesquita","id":646271,"avatar_url":"https://avatars.githubusercontent.com/u/646271?v=3","gravatar_id":"","url":"https://api.github.com/users/avmesquita","html_url":"https://github.com/avmesquita","followers_url":"https://api.github.com/users/avmesquita/followers","following_url":"https://api.github.com/users/avmesquita/following{/other_user}","gists_url":"https://api.github.com/users/avmesquita/gists{/gist_id}","starred_url":"https://api.github.com/users/avmesquita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avmesquita/subscriptions","organizations_url":"https://api.github.com/users/avmesquita/orgs","repos_url":"https://api.github.com/users/avmesquita/repos","events_url":"https://api.github.com/users/avmesquita/events{/privacy}","received_events_url":"https://api.github.com/users/avmesquita/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-24T18:01:12Z","updated_at":"2015-06-09T21:05:42Z","closed_at":"2015-06-09T21:05:42Z","body":"This code works for me.\r\n\r\n/*!\r\n\r\nName: Instagram Lite\r\nDependencies: jQuery\r\nAuthor: Michael Lynch\r\nAuthor URL: http://michaelynch.com\r\nDate Created: January 14, 2014\r\nLicensed under the MIT license\r\n\r\n*/\r\n\r\n;(function($) {\r\n\r\n    $.fn.instagramLite = function(options) {\r\n    \r\n    \t//return if no element was bound\r\n\t\t//so chained events can continue\r\n\t\tif(!this.length) { \r\n\t\t\treturn this; \r\n\t\t}\r\n\r\n\t\t//define default parameters\r\n        var defaults = {\r\n            username: null,\r\n            clientID: null,\r\n            limit: 10,\r\n            list: true,\r\n            urls: false,\r\n            error: function() {},\r\n            success: function() {}\r\n        }\r\n        \r\n        //define plugin\r\n        var plugin = this;\r\n\r\n        //define settings\r\n        plugin.settings = {}\r\n \r\n        //merge defaults and options\r\n        plugin.settings = $.extend({}, defaults, options);\r\n\r\n        //define element\r\n        var el = $(this);\r\n        \r\n        //if client ID and username were provided\r\n        if(plugin.settings.clientID && plugin.settings.username) {\r\n        \r\n\t        //for each element\r\n\t        el.each(function() {\r\n\t        \r\n\t        \t//search the user\r\n\t        \t//to get user ID\r\n\t        \t$.ajax({\r\n\t\t        \ttype: 'GET',\r\n\t\t        \turl: 'https://api.instagram.com/v1/users/search?q='+plugin.settings.username+'&client_id='+plugin.settings.clientID+'&callback=?',\r\n\t\t        \tdataType: 'jsonp',\r\n\t\t        \tsuccess: function(data) {\r\n\t\t        \t\r\n\t\t        \t\t//for each user returned\r\n\t\t        \t\tfor(var i = 0; i < data.data.length; i++) {\r\n\t\t        \t\t\r\n\t\t        \t\t\t//define user namespace\r\n\t\t\t        \t\tvar thisUser = data.data[i];\r\n\t\t\t        \t\t\r\n\t\t\t        \t\t//if returned username matches supplied username\r\n\t\t\t        \t\tif(thisUser.username === plugin.settings.username) {\r\n\t\t\t        \t\t\r\n\t\t\t        \t\t\t//get user's media using their ID\r\n\t\t\t        \t\t\t$.ajax({\r\n\t\t\t\t\t\t        \ttype: 'GET',\r\n\t\t\t\t\t\t        \turl: 'https://api.instagram.com/v1/users/'+thisUser.id+'/media/recent/?client_id='+plugin.settings.clientID+'&count='+plugin.settings.limit+'&callback=?',\r\n\t\t\t\t\t\t        \tdataType: 'jsonp',\r\n\t\t\t\t\t\t        \tsuccess: function(data) {\r\n\t\t\t\t\t\t        \t\t\r\n\t\t\t\t\t\t        \t\tif(data.meta.code === 200) {\r\n\t\t\r\n\t\t\t\t\t\t\t        \t\t//for each piece of media returned\r\n\t\t\t\t\t\t\t        \t\tfor(var i = 0; i < data.data.length; i++) {\r\n\t\t\t\t\t\t\t        \t\t\r\n\t\t\t\t\t\t\t        \t\t\t//define media namespace\r\n\t\t\t\t\t\t\t        \t\t\tvar thisMedia = data.data[i];\r\n\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t        \t\t\t//if media type is image\r\n\t\t\t\t\t\t\t        \t\t\tif(thisMedia.type === 'image') {\r\n\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t        \t\t\t    //construct image\r\n\t\t\t\t\t\t\t        \t\t\t    var urlInstagram = thisMedia.images.standard_resolution.url;\r\n\t\t\t\t\t\t\t\t        \t\t\tvar img = '<img src=\"'+urlInstagram.replace(\"http://\",\"https://\")+'\" alt=\"Instagram Image\" data-filter=\"'+thisMedia.filter+'\" />';\r\n\t\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t        \t\t\t    //if url setting is true\r\n\t\t\t\t\t\t\t\t        \t\t\tif(plugin.settings.urls) {\r\n\t\t\t\t\t\t\t\t        \t\t\t    var linkInstagram = thisMedia.link;\r\n\t\t\t\t\t\t\t\t        \t\t\t    var img = '<a href=\"' + linkInstagram.replace(\"http://\", \"https://\") + '\" target=\"_blank\">' + img + '</a>';\r\n\t\t\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t\t        \t\t\t}\r\n\t\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t\t        \t\t\t//if list setting is true\r\n\t\t\t\t\t\t\t\t        \t\t\tif(plugin.settings.list) {\r\n\t\t\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t\t\t        \t\t\tvar img = '<li>'+img+'</li>';\r\n\t\t\t\t\t\t\t\t        \t\t\t}\r\n\t\t\t\t\t\t\t\t        \t\t\r\n\t\t\t\t\t\t\t\t        \t\t\t//append image\r\n\t\t\t\t\t\t\t\t        \t\t\tel.append(img);\r\n\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t        \t\t\t}\r\n\t\t\t\t\t\t\t        \t\t\t\r\n\t\t\t\t\t\t\t        \t\t}\r\n\t\t\t\t\t\t\t        \t\t\r\n\t\t\t\t\t\t\t        \t\t//execute error callback\r\n\t\t\t\t\t\t\t        \t\tplugin.settings.success.call(this);\r\n\t\t\t\t\t\t        \t\t\r\n\t\t\t\t\t\t        \t\t} else {\r\n\t\t\t\t\t\t\t        \t\t\r\n\t\t\t\t\t\t\t        \t\t//execute error callback\r\n\t\t\t\t\t\t\t        \t\tplugin.settings.error.call(this, data.meta.code, data.meta.error_message);\r\n\t\t\t\t\t\t\t        \t\t\r\n\t\t\t\t\t\t        \t\t}\r\n\t\t\t\t\t\t        \t\r\n\t\t\t\t\t\t        \t},\r\n\t\t\t\t\t\t        \terror: function() {\r\n\t\t\t\t\t\t        \t\r\n\t\t\t\t\t\t        \t\t//execute error callback\r\n\t\t\t\t\t\t        \t\tplugin.settings.error.call(this);\r\n\t\t\t\t\t\t\t        \t\r\n\t\t\t\t\t\t        \t}\r\n\t\t\t\t\t\t        });\r\n\t\t\t        \t\t\r\n\t\t\t\t        \t\tbreak;\r\n\t\t\t\t        \t\t\r\n\t\t\t        \t\t}\r\n\t\t\t        \t\t\r\n\t\t        \t\t}\r\n\t\t\t        \t\r\n\t\t        \t},\r\n\t\t        \terror: function() {\r\n\t\t        \t\r\n\t\t        \t\t//execute error callback\r\n\t\t\t\t\t\tplugin.settings.error.call(this);\r\n\t\t\t        \t\r\n\t\t        \t}\r\n\t        \t});\r\n\t        \r\n\t        });\r\n        \r\n        } else {\r\n        \r\n        \tconsole.log('Both a client ID and username are required to use this plugin.');\r\n\t        \r\n        }\r\n\r\n    }\r\n\r\n})(jQuery);"},"comment":{"url":"https://api.github.com/repos/michael-lynch/instagram-lite/issues/comments/110504270","html_url":"https://github.com/michael-lynch/instagram-lite/issues/5#issuecomment-110504270","issue_url":"https://api.github.com/repos/michael-lynch/instagram-lite/issues/5","id":110504270,"user":{"login":"michael-lynch","id":1568524,"avatar_url":"https://avatars.githubusercontent.com/u/1568524?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-lynch","html_url":"https://github.com/michael-lynch","followers_url":"https://api.github.com/users/michael-lynch/followers","following_url":"https://api.github.com/users/michael-lynch/following{/other_user}","gists_url":"https://api.github.com/users/michael-lynch/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-lynch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-lynch/subscriptions","organizations_url":"https://api.github.com/users/michael-lynch/orgs","repos_url":"https://api.github.com/users/michael-lynch/repos","events_url":"https://api.github.com/users/michael-lynch/events{/privacy}","received_events_url":"https://api.github.com/users/michael-lynch/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T21:05:42Z","updated_at":"2015-06-09T21:05:42Z","body":"If you'd like to make an update, please describe what it is you have done and make a pull request with your changes. Thanks!"}}