Skip to content

Instantly share code, notes, and snippets.

@dhigginbotham
Created March 30, 2017 01:24
Show Gist options
  • Save dhigginbotham/13067f6ee6b3591678f02ddf8895bce8 to your computer and use it in GitHub Desktop.
Save dhigginbotham/13067f6ee6b3591678f02ddf8895bce8 to your computer and use it in GitHub Desktop.
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