2.3.4 • Published 6 years ago

comicscraper v2.3.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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

2.3.4

6 years ago

2.3.3

6 years ago

2.3.2

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago