Skip to content

Instantly share code, notes, and snippets.

@DanNi0130
Created July 19, 2018 01:33
Show Gist options
  • Save DanNi0130/455d22971fc1481c02843e469490fd76 to your computer and use it in GitHub Desktop.
Save DanNi0130/455d22971fc1481c02843e469490fd76 to your computer and use it in GitHub Desktop.
const rp = require('request-promise');
const $ = require('cheerio');
const potusParse = function(url) {
return rp(url)
.then(function(html) {
return {
name: $('.firstHeading', html).text(),
birthday: $('.bday', html).text(),
};
})
.catch(function(err) {
//handle error
});
};
module.exports = potusParse;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment