0.1.1 • Published 10 years ago

thegamesdb-api v0.1.1

Weekly downloads
1
License
-
Repository
-
Last release
10 years ago

thegamesdb-api

Simple wrapper for thegamesdb's API (see http://wiki.thegamesdb.net/index.php?title=API_Introduction)

Installation

npm install thegamesdb-api

Usage

var gamesdb = require('thegamesdb-api')

// All methods return a callback in this form:
var cb = function(err,result)
{
    if (!err)
    {
        console.log(JSON.stringify(result,undefined,2));
    }
}

// Available methods:
gamesdb.GetGame(id, cb);                  // Get JSON object describing game by thegamesdb id
gamesdb.GetGameList(name,cb)              // Get JSON object listing all games that match 'name'
gamesdb.GetPlatform(id,cb);               // Get JSON object describing platform by id
gamesdb.GetArt(id,cb);                    // Get JSON object describing available art (covers, screenshots, etc.) by id
gamesdb.GetPlatformGames(platformId,cb);  // Get JSON object describing all games on platform by platform Id
gamesdb.PlatformGames(platformId,cb);     // Same?
gamesdb.Updates(sinceTime,cb);            // Get JSON object describing updates to gamesdb since timestamp
gamesdb.GetPlatformList(undefined,cb);    // Get the list of all platforms on gamesdb.

Todo/Roadmap

* Add test cases
* Extend art functionality to stream art instead of just retrieving meta data.