lib/steamspy.js
function ( method, params, cb ) {
        if ( typeof params === 'function' ) {
            cb = params;
            params = {};
        }
        params = extend(params, {request: method});
        this.__request({
            method: 'get',
            url: this.options.api_url,
            qs: params
        }, function ( err, response, data ) {
            if ( err ) {
                cb(err, response, data);
            } else {
                try {
                    data = JSON.parse(data);
                } catch ( parseError ) {
                    cb(new Error('Status Code: ' + response.statusCode), response, data);
                }

                if ( response.statusCode === 200 ) {
                    cb(null, response, data);
                } else {
                    cb(new Error('Status Code: ' + response.statusCode), response, data);
                }
            }
        });
    }
function ( method, params, cb ) {
        if ( typeof params === 'function' ) {
            cb = params;
            params = {};
        }
        params = extend(params, {request: method});
        this.__request({
            method: 'get',
            url: this.options.api_url,
            qs: params
        }, function ( err, response, data ) {
            if ( err ) {
                cb(err, response, data);
            } else {
                try {
                    data = JSON.parse(data);
                } catch ( parseError ) {
                    cb(new Error('Status Code: ' + response.statusCode), response, data);
                }

                if ( response.statusCode === 200 ) {
                    cb(null, response, data);
                } else {
                    cb(new Error('Status Code: ' + response.statusCode), response, data);
                }
            }
        });
    }
function ( method , params , cb ) { if ( typeof params === 'function' ) { cb = params ; params = { } ; } params = extend ( params , { request : method } ) ; this . __request ( { method : 'get' , url : this . options . api_url , qs : params } , function ( err , response , data ) { if ( err ) { cb ( err , response , data ) ; } else { try { data = JSON . parse ( data ) ; } catch ( parseError ) { cb ( new Error ( 'Status Code: ' + response . statusCode ) , response , data ) ; } if ( response . statusCode === 200 ) { cb ( null , response , data ) ; } else { cb ( new Error ( 'Status Code: ' + response . statusCode ) , response , data ) ; } } } ) ; }
Makes a single request to SteamSpy API. Use this in case of absence of shorthands
@param {String} method API request method (e.g 'appdetails', 'top100in2weeks')
@param {Object} params API request parameters applied to URL querystring (e.g {appid: 730})
@param {SteamSpy~requestCallback} cb Callback executed after API response
Makes a single request to SteamSpy API . Use this in case of absence of shorthands