ninjs-html
Version:
web crawling engine using cheerio for html/dom manipulation and templating
154 lines (115 loc) • 4.98 kB
JavaScript
const _ = require('ninjs-lodash')
const html = require('.')
const cwd = process.cwd()
const env = _.acopy(process.env, { 'NODE_ENV': 'development', 'DEBUG': '*' })
exports = module.exports = {
cmd: cmd,
$: $,
api: api,
backbone: backbone,
giphy: giphy,
google: google,
npm: npm,
emojipedia: emojipedia,
emojisheet: emojisheet,
fullmatchesandshows: fullmatchesandshows,
footytube: footytube,
kisscartoon: kisscartoon,
buzzfeed: buzzfeed,
liveleak: liveleak,
pornhub: pornhub,
pandamovies: pandamovies,
howtogeek: howtogeek
}
function cmd(options, callback) {
let { cmd='', args=[] } = options
if(!cmd) return
_.cmd({ cmd:cmd, args:['--name=api'], cwd: cwd, env: env }, (err, result) => {
if(err) {
console.log(`\n${err}\n`)
return _.fail(err, callback)
}
console.log(`\n${result}\n`)
return _.done(result, callback)
})
}
function $() { cmd({ cmd:'node test', args:['--name=$'] }, (err, result) => { }) }
function api() { cmd({ cmd:'node test', args:['--name=api'] }, (err, result) => { }) }
function backbone() { cmd({ cmd:'node test', args:['--name=backbone'] }, (err, result) => { }) }
function giphy() { cmd({ cmd:'node test', args:['--name=giphy'] }, (err, result) => { }) }
function google() { cmd({ cmd:'node test', args:['--name=google'] }, (err, result) => { }) }
function npm() { cmd({ cmd:'node test', args:['--name=npm'] }, (err, result) => { }) }
// EMOJI
function emojipedia() { cmd({ cmd:'node test', args:['--name=emojipedia'] }, (err, result) => { }) }
function emojisheet() { cmd({ cmd:'node test', args:['--name=emojisheet'] }, (err, result) => { }) }
// SOCCER
function fullmatchesandshows() { cmd({ cmd:'node test', args:['--name=fullmatchesandshows'] }, (err, result) => { }) }
function footytube() { cmd({ cmd:'node test', args:['--name=footytube'] }, (err, result) => { }) }
// ENTERTAINMENT
function kisscartoon() { cmd({ cmd:'node test', args:['--name=kisscartoon'] }, (err, result) => { }) }
// CONTENT
function buzzfeed() { cmd({ cmd:'node test', args:['--name=buzzfeed'] }, (err, result) => { }) }
function liveleak() { cmd({ cmd:'node test', args:['--name=liveleak'] }, (err, result) => { }) }
// PORN
function pornhub() { cmd({ cmd:'node test', args:['--name=pornhub'] }, (err, result) => { }) }
function pandamovies() { cmd({ cmd:'node test', args:['--name=pandamovies'] }, (err, result) => { }) }
// Geek
function howtogeek() { cmd({ cmd:'node test', args:['--name=howtogeek'] }, (err, result) => { }) }
// MUSIC
function soundcloud() { cmd({ cmd:'node test', args:['--name=soundcloud'] }, (err, result) => { }) }
// // DEV
// ### pornhub
// #### [www.pornhub.com](http://www.pornhub.com/)
// ### pandamovies
// #### [www.pandamovies.com](http://www.pandamovies.com/)
// ---
// ## Content
// ---
// ### buzzfeed
// #### [www.buzzfeed.com](https://www.buzzfeed.com/)
// ### liveleak
// #### [www.liveleak.com](http://www.liveleak.com/)
// ---
// ## Geek
// ---
// ### howtogeek
// #### [www.howtogeek.com](http://www.howtogeek.com/)
// #### [disable-caps-lock-key-in-windows-vista](http://www.howtogeek.com/howto/windows-vista/disable-caps-lock-key-in-windows-vista/)
// ---
// ## Development
// ---
// ### jquery
// #### [jquery.com](https://jquery.com/)
// ### github
// #### [github.com](https://github.com)
// #### [request/request](https://github.com/request/request)
// ### lodash
// #### [lodash.com](https://lodash.com/)
// #### [lodash.com/docs/4.16.4](https://lodash.com/docs/4.16.4)
// ### backbonejs
// #### [backbonejs.org](http://backbonejs.org/)
// ### electron
// #### [electron.atom.io](http://electron.atom.io/)
// #### [electron.atom.io/apps/](http://electron.atom.io/apps/)
// #### [electron.atom.io/docs](http://electron.atom.io/docs/)
// #### [electron.atom.io/blog](http://electron.atom.io/blog/)
// #### [electron.atom.io/community](http://electron.atom.io/community/)
// #### [electron.atom.io/apps](http://electron.atom.io/apps/)
// #### [electron.atom.io/releases](http://electron.atom.io/releases/)
// #### [discuss.atom.io/c/electron](https://discuss.atom.io/c/electron)
// ### atom.io
// #### [atom.io](https://atom.io/)
// #### [@AtomEditor](@AtomEditor)
// #### [github.com/atom/atom](https://github.com/atom/atom)
// #### [atom-slack.herokuapp.com](http://atom-slack.herokuapp.com/)
// #### [atom.io/packages](https://atom.io/packages)
// #### [atom.io/themes](https://atom.io/themes)
// #### [atom.io/docs](https://atom.io/docs)
// #### [blog.atom.io](http://blog.atom.io/)
// #### [discuss.atom.io](https://discuss.atom.io/)
// #### [atom.io/packages.atom](https://atom.io/packages.atom)
// #### [atom.io/releases](https://atom.io/releases)
// #### [atom.io/faq](https://atom.io/faq)
// #### [atom.io/contact](https://atom.io/contact)
// ---