Last active
December 14, 2017 19:10
-
-
Save tuchk4/d532d84b527aac37538f947ce05a167e 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
#!/usr/bin/env node | |
const fetch = require('node-fetch'); | |
const cheerio = require('cheerio'); | |
const chalk = require('chalk'); | |
fetch('http://kharkivjs.org/') | |
.then(response => response.text()) | |
.then(html => { | |
const $ = cheerio.load(html); | |
const speakers = []; | |
$('.speaker-item-info-name').each((index, node) => { | |
speakers.push($(node).text()); | |
}); | |
console.log('KharkivJS Speakers:'); | |
console.log(''); | |
speakers.forEach(speaker => { | |
console.log(` - ${chalk.green(speaker)}`); | |
}); | |
console.log(''); | |
}); |
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
{ | |
"name": "kharkivjs", | |
"version": "0.0.1", | |
"bin": "./index.js", | |
"dependencies": { | |
"chalk": "^2.3.0", | |
"cheerio": "^1.0.0-rc.2", | |
"node-fetch": "^1.7.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment