Webcomic scraper
npm install comicscraper --save
NOTE: All return values are promises.
To include in your Node project
const comicHandler = require('./comicscraper/comicHandler';
Connect to MongoDB database
comicHandler.connect(config.mongoAuth);
// Further processing
Disconnect from MongoDB database
comicHandler.disconnect();
Parse a supported webcomic link (see note on current suport) and return a comic object (mongoose Schema)
comicHandler.parse('https://xkcd.com/').then(comic => {
// Comic processing here
}).catch(err => {
// Error handling here
});
Search linked database for input comic object and return it if present
comicHandler.get(comicObject).then(comic => {
// Comic processing here
}).catch(err => {
// Error handling here
});
Update linked database if input comic Object is different than the most recent stored in database
comicHandler.update(comicObj).then(status => {
console.log(status);
}).catch(err => {
// Error handling here
});
xkcd
Girl Genius
Saturday Morning Breakfast Cereal
Abstruse Goose
This project is unaffiliated with any of the supported comics, and will remove support of any comic at its owners' request.
Modified from this tutorial