comicscraper

2.3.4 • Public • Published

comicscraper

Webcomic scraper

npm npm

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

Package Sidebar

Install

npm i comicscraper

Weekly Downloads

1

Version

2.3.4

License

MIT

Unpacked Size

9.36 kB

Total Files

5

Last publish

Collaborators

  • ambiscript