JSPM

  • Created
  • Published
  • Downloads 68
  • Score
    100M100P100Q76871F

Easily access information about yourself and your friends on the Steam community website.

Package Exports

  • steam-community

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (steam-community) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Steam Community

Easily access information about yourself and your friends on the Steam community website. Given a 64bit Steam ID, this module retrieves a user's XML from the Steam Community site and returns a parsed JSON object. Awesome!

Includes configurable timeouts and retry, provided by the Re package.

Install

  npm install steam-community

Usage

Get your 64bit steam ID and plug it in. You'll get back an object with all the infos.

var steam = require('steam-community'),
    client = steam();

client.user("12345678901234567", function(err, user){
        console.log(util.inspect(user, false, 4, true));
});

There's also a games function. You use it like this:

var steam = require('steam-community'),
    client = steam();

client.games("12345678901234567", function(err, games){
        console.log(util.inspect(games, false, 4, true));
});	

Where games is a JSON array of objects that look something like this:

{ 
   "appID": "42910",
   "name": "Magicka",
   "logo": "http://media.steampowered.com/steamcommunity/public/images/apps/42910/8c59c674ef40f59c3bafde8ff0d59b7994c66477.jpg",
   "storeLink": "http://store.steampowered.com/app/42910",
   "hoursOnRecord": "1.1",
   "statsLink": "http://steamcommunity.com/profiles/12345678901234567/stats/Magicka",
   "globalStatsLink": "http://steamcommunity.com/stats/Magicka/achievements/"
} 

Options

The default options look like this:

var options = {
    timeout : 10000,
    retries : 10,
    strategy : {
        "type": steam.STRATEGIES.EXPONENTIAL,
        "initial":800,
        "base":2,
        "max":3200
    }
}

everything except timeout is documented in Re, (and get's passed to it).