Skip to content

Instantly share code, notes, and snippets.

@osahyoun
Last active August 20, 2016 09:57
Show Gist options
  • Save osahyoun/c4a45cd5aa6bda3e8894d27791238d01 to your computer and use it in GitHub Desktop.
Save osahyoun/c4a45cd5aa6bda3e8894d27791238d01 to your computer and use it in GitHub Desktop.
Display Your Instagram Feed With 14 Lines of Code
<html>
<body>
<!--This requires a bitsalad URL (www.bitsalad.co) for your instagram feed, and append ?callback=_i to the URL.-->
<div id='instagram-feed'></div>
<script>
(function(a,b,c,d){
var $ = b.getElementById('instagram-feed');
a['_i'] = function(d){
d.forEach(function(i, x){
html = "<img src='"+i.images.standard_resolution.url+"' />";
$.insertAdjacentHTML('beforeend', html);
})
};
var e = b.createElement(c);
e.src = d;
e.async=1;
var f = b.getElementsByTagName(c)[0];
f.parentNode.insertBefore(e,f);
}(window, document, 'script','http://api.bitsalad.co/v1/feeds/9?callback=_i'))
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment