Skip to content

Instantly share code, notes, and snippets.

@beaugunderson
Last active May 18, 2017 06:06
Show Gist options
  • Save beaugunderson/7ae89d3576c18a2f056c to your computer and use it in GitHub Desktop.
Save beaugunderson/7ae89d3576c18a2f056c to your computer and use it in GitHub Desktop.
var request = require('request');
var cheerio = require('cheerio');
var fs = require('fs');
console.log('retrieving unicode table...');
request.get('http://unicode.org/emoji/charts/full-emoji-list.html', function (err, response, body) {
console.log('loading data...');
var $ = cheerio.load(body);
var emoji = $('td.chars').map(function () {
return $(this).text();
}).toArray();
console.log('writing file...');
fs.writeFile('./emoji.json', JSON.stringify(emoji, null, 2), function (err) {
console.log('done');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment