Skip to content

Instantly share code, notes, and snippets.

@EtherTyper
Created January 27, 2016 19:30
Show Gist options
  • Save EtherTyper/ca736d4cef07712134e7 to your computer and use it in GitHub Desktop.
Save EtherTyper/ca736d4cef07712134e7 to your computer and use it in GitHub Desktop.
Early version of my new GitHub v3 App, Emoji, @ <https://ethertyper.github.io/emoji/>
<html>
<head>
<title>
ALL THE EMOJIS!
</title>
</head>
<body>
<div id="emoji">
<button onclick="emoji()">
Click me
</button>
</div>
<script>
var emojiURLs;
var emojiPics="";
var oReq = new XMLHttpRequest();
oReq.onload = reqListener;
oReq.open("get", "https://api.github.com/emojis", true);
oReq.send();
function reqListener(e) {
emojiURLs = JSON.parse(this.responseText);
}
function emoji(){
emojiPics+="<h1 style='text-align: center; width: screen.width'><strong><em>ALL THE EMOJI</em></strong></h1>";
for (var emoji in emojiURLs){
emojiPics=emojiPics+"<img src='"+emojiURLs[emoji]+"' alt=':"+emoji+":' title=':"+emoji+":' height='30' width='30'>";
}
document.getElementById("emoji").innerHTML=emojiPics;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment