What.CD JSON API library
Simple, idiomatic access to the API features of What.CD.
What.CD provides a JSON API to registered users. This library aims to maintain coverage of all features within a reasonable timeframe and provide an easy to use and obvious surface.
This should also work on other Gazelle-based websites, but will be tested with what.cd only.
npm install whatcd
git clone git://github.com/deoxxa/whatcd.git
var WhatCD = require"whatcd";var client = "" "username" "password";clientindexif errreturn console.logerr;console.logdata;;
METHOD is one of the methods below and PARAMETERS is an object that maps directly to URL parameters in the request to the website. For more information, see this article. You will need to be logged in to view it.
There's also an
api_request method that automatically handles login and such,
and is in fact what all the rest of these methods are built upon. You can use it
to make arbitrary requests to the website while ensuring that the correct steps
have been taken to ensure that you're authenticated.
PARAMETERS is the same as before, where each property maps to a query string parameter. To request the index, for example, you would do this:
This is exactly how all the methods listed below operate under the hood.
3-clause BSD. A copy is included with the source.