Created
March 30, 2017 01:24
-
-
Save dhigginbotham/13067f6ee6b3591678f02ddf8895bce8 to your computer and use it in GitHub Desktop.
This file contains 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
const emojiContainer = document.getElementById('custom_emoji'); | |
const emojis = emojiContainer.querySelectorAll('tr.emoji_row'); | |
const scrapped = Array.prototype.slice.call(emojis).map((row) => { | |
const url = row.querySelector('span.emoji-wrapper').getAttribute('data-original'); | |
const name = row.querySelector('[headers="custom_emoji_name"]').innerText; | |
return { name, url }; | |
}); | |
console.log('total emojis: ', scrapped.length); | |
console.log('data model: ', scrapped[Math.floor(Math.random() * scrapped.length)]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment