node package manager

gosugamers-match

gosugamers-match

Build Status Dependency Status

Parse a CS:GO match page from GosuGamers.

GosuGamers provides no API so I have no choice but to download their HTML pages, parse the HTML for important stuff, and parse that stuff into appropriate JavaScript values. With dependencies this module is like 84 kB minified and gzipped which is just ridiculous.

Example

var gosugamersMatch = require('gosugamers-match');
 
gosugamersMatch('excessively long gosugamers url', function(error, data) {
  if (error) {
    throw error;
  }
 
  console.log(data);
  // => { 
  // =>   opponent1: 'Team LDLC', 
  // =>   opponent2: 'fnatic', 
  // =>   score1: 1, 
  // =>   score2: 3, 
  // =>   date: 1415548800 
  // => } 
});

Installation

$ npm install gosugamers-match

API

var gosugamersMatch = require('gosugamers-match');

gosugamersMatch(url, callback)

Calls callback(error, data), where error is any Error encounted and data is an Object containing some info on the match described in String url.