Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

curvefever-stats

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curvefever-stats - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.travis.yml

18

curve.js

@@ -59,2 +59,20 @@ var async = require('async');

Curver.prototype.getLastMatch = function (normalAliases, cb) {
if (!normalAliases) {
return cb(new Error("no aliases specified"));
}
var users = this.league.convert(normalAliases);
scraper.findLastMatchId(users[0], function (err, id) {
if (err) {
return cb(err);
}
scraper.getLastMatch(id, function (err, data) {
if (err) {
return cb(err);
}
cb(null, data);
});
});
};
Curver.prototype.addPlayer = function (name, alias) {

@@ -61,0 +79,0 @@ if (this.league.aliases[name] !== alias) {

2

package.json

@@ -5,3 +5,3 @@ {

"author": "Eirik Albrigtsen <analsandblaster@gmail.com>",
"version": "0.0.1",
"version": "0.0.2",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -1,2 +0,3 @@

# Curvefever-stats
# curvefever-stats [![Build Status](https://secure.travis-ci.org/clux/curvefever-stats.png)](http://travis-ci.org/clux/curvefever-stats) [![Dependency Status](https://david-dm.org/clux/curvefever-stats.png)](https://david-dm.org/clux/curvefever-stats)
Curvefever-stats is a stat calculator and match maker library for the [curvefever game](http://curvefever.com).

@@ -3,0 +4,0 @@

@@ -7,3 +7,3 @@ var request = require('request')

request("http://curvefever.com/users/" + player, function (err, resp, body) {
if (!err && resp.statusCode === 200) {
if (!err && resp && resp.statusCode === 200) {
var $ = cheerio.load(body);

@@ -18,3 +18,4 @@ var stats = $('.profile dd');

else {
cb(new Error("Request for player " + player + " failed: " + resp.statusCode));
var code = resp && resp.statusCode;
cb(new Error("Request for player " + player + " failed: " + code));
}

@@ -27,3 +28,3 @@ });

request("http://curvefever.com/users/" + player, function (err, resp, body) {
if (!err && resp.statusCode === 200) {
if (!err && resp && resp.statusCode === 200) {
var $ = cheerio.load(body);

@@ -43,3 +44,4 @@ var stats = $('.profile dd');

else {
cb(new Error("Request for player " + player + " failed: " + resp.statusCode));
var code = resp && resp.statusCode;
cb(new Error("Request for player " + player + " failed: " + code));
}

@@ -51,3 +53,3 @@ });

request('http://curvefever.com/achtung/match/' + id, function (err, resp, body) {
if (!err && resp.statusCode === 200) {
if (!err && resp && resp.statusCode === 200) {
var $ = cheerio.load(body);

@@ -59,3 +61,2 @@ var stats = $('.content').find('table tbody tr');

var scores = [];
var scoreReg = /(\d*) \((\d*)\)/;

@@ -82,5 +83,6 @@ for (var i = 0; i < stats.length; i += 1) {

else {
cb(new Error("Request for match " + id + " failed: " + resp.statusCode));
var code = resp && resp.statusCode;
cb(new Error("Request for match " + id + " failed: " + code));
}
});
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc