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.
- bookmarks_artists (or bookmarksArtists)
- bookmarks_torrents (or bookmarksTorrents)
- forum_main (or forumMain)
- forum_viewforum (or forumViewForum)
- forum_viewthread (or forumViewThread)
- inbox_inbox (or inboxInbox)
- inbox_sentbox (or inboxSentbox)
- inbox_viewconv (or inboxViewconv)
- top10_tags (or top10Tags)
- top10_torrents (or top10Torrents)
- top10_users (or top10Users)
3-clause BSD. A copy is included with the source.