comichron-data/browser-client
xhr-based client for https://github.com/comichron-data/api
Install
npm install comichron-data-browser-client --save
Usage
See demo entry file for usage examples.
API
var client = ;
client.titles(callback)
Get titles of all comics that have data in the api.
- callback - function with signature
function(error, titles)
whereerror
is non-null
if there was a failure. On success,error
will benull
andtitles
will be json of the titles response.
client.byMonth(id, callback)
Get a comic's by-month data.
- id - Comic id from titles response
- callback - function with signature
function(error, data)
whereerror
is non-null
if there was a failure. On success,error
will benull
anddata
will be json of the by-month response.
client.byIssue(id, callback)
Get a comic's by-issue data.
- id - Comic id from titles response
- callback - function with signature
function(error, data)
whereerror
is non-null
if there was a failure. On success,error
will benull
anddata
will be json of the by-issue response.
client.sourceData(year, month, callback)
Get source data for a specific year/month.
- year - 4 digit year. String or Number.
- month - 1 or 2 digit month. January is 1. String or Number.
- callback - function with signature
function(error, records)
whereerror
is non-null
if there was a failure. On success,error
will benull
andrecords
will be json of the source data response.
License
MIT