Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1.16 KB

README.md

File metadata and controls

31 lines (23 loc) · 1.16 KB

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.