comicscraper
v2.3.4
Published
webcomic scraper
Downloads
9
Readme
comicscraper
Webcomic scraper
Installation
npm install comicscraper --save
Usage
NOTE: All return values are promises.
To include in your Node project
const comicHandler = require('./comicscraper/comicHandler';
connect(authToken)
Connect to MongoDB database
comicHandler.connect(config.mongoAuth);
// Further processing
disconnect()
Disconnect from MongoDB database
comicHandler.disconnect();
parse(comicURL)
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
});
get(comicObject)
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(comicObject)
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
});
Currently supports
xkcd
Girl Genius
Saturday Morning Breakfast Cereal
Abstruse Goose
Note
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