Skip to content

Instantly share code, notes, and snippets.

@tuchk4
Last active December 14, 2017 19:10
Show Gist options
  • Save tuchk4/d532d84b527aac37538f947ce05a167e to your computer and use it in GitHub Desktop.
Save tuchk4/d532d84b527aac37538f947ce05a167e to your computer and use it in GitHub Desktop.
#!/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('');
});
{
"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