numberisnan / gocomics-api

A public API/scraper for images on gocomics.com

Home Page:https://www.npmjs.com/package/gocomics-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gocomics-api

A public API for gocomics.com. Uses scraping of response HTML to locate the actual image URL.

const { getImage } = require("gocomics-api");

const imageString = getImage({
    date: [2019,1,1],
    comicName: "bignate",
    URLOnly: true
})

getImage(Object) ⇒ Promise.<(String|Request)>

Request comic image

Kind: global function
Returns: Promise.<(String|Request)> - Promise object represents an instance of request() from the request library for the image, or String with image URL

Param Type Description
Object options
options.date Array.<Number> An array with date in the form [year,month,day]
options.comicName String Name of comic strip \n e.g. garfield, bignate
options.URLOnly Boolean If true, will return only the URL of the image, not wrapped in a Request object

Bugs

The scraper relied heavily on the gocomics.com site to keep their website consistent, so a change may break the module. If that happens, be sure to submit a pull request or issue.

About

A public API/scraper for images on gocomics.com

https://www.npmjs.com/package/gocomics-api


Languages

Language:JavaScript 100.0%