Last active
August 20, 2016 09:57
-
-
Save osahyoun/c4a45cd5aa6bda3e8894d27791238d01 to your computer and use it in GitHub Desktop.
Display Your Instagram Feed With 14 Lines of Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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