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

yahoo-fantasy

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yahoo-fantasy - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

6

helpers/playerHelper.js

@@ -28,6 +28,6 @@ var _ = require('lodash');

);
playerObj.selected_position = playerObj.selected_position[1].position;
playerObj.starting_status = ( playerObj.starting_status ) ? playerObj.starting_status[1].is_starting : 0;
playerObj.selected_position = mergeObjects(playerObj.selected_position);
playerObj.starting_status = mergeObjects(playerObj.starting_status);
return playerObj;

@@ -34,0 +34,0 @@ };

@@ -29,3 +29,3 @@ var _ = require('lodash');

players = _.filter(players, function(p) { return typeof(p) === 'object'; });
players = _.map(players, function(p) { return p.player[0]; });
players = _.map(players, function(p) { return _.flatten(p.player); });
players = _.map(players, function(p) { return playerHelper.mapPlayer(p); });

@@ -32,0 +32,0 @@

{
"name": "yahoo-fantasy",
"version": "0.4.1",
"version": "0.4.2",
"description": "An API to help facilitate the use of the Yahoo! Fantasy Sports API in NodeJS projects.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -58,2 +58,7 @@ Yahoo! Fantasy API Node Module

#### 0.4.2
* Added the ability to specify a date or week when querying the roster resource.
* Cleaned up the player normalization model
* Fixed a bug where the team.roster call was erroring
#### 0.4.1

@@ -60,0 +65,0 @@ * Fixes to how POST data is handled

@@ -9,5 +9,22 @@ var teamHelper = require('../helpers/teamHelper.js');

RosterResource.prototype.players = function(teamKey, cb) {
var apiCallback = this._players_callback.bind(this, cb);
RosterResource.prototype.players = function(teamKey, date, cb) {
var url = 'http://fantasysports.yahooapis.com/fantasy/v2/team/' + teamKey + '/roster';
if ( 2 == arguments.length ) {
cb = date;
date = null;
} else if ( 3 == arguments.length ) {
if ( date.indexOf('-') > 0 ) {
// string is date, of format y-m-d
url += ';date=' + date;
} else {
// number is week...
url += ';week=' + date;
}
}
var apiCallback = this._players_callback.bind(this, cb);
url += '?format=json';
this

@@ -17,3 +34,3 @@ .yf

this.yf.GET,
'http://fantasysports.yahooapis.com/fantasy/v2/team/' + teamKey + '/roster/players?format=json',
url,
apiCallback

@@ -20,0 +37,0 @@ );

@@ -74,7 +74,7 @@ var teamHelper = require('../helpers/teamHelper.js');

var apiCallback = this._roster_callback.bind(this, cb);
// (teamKey, week, cb)
// 'http://fantasysports.yahooapis.com/fantasy/v2/team/' + teamKey + '/roster;weeks=' + weeks.split(',') + '?format=json'
this
.yf
.api(
this.yf.GET,
'http://fantasysports.yahooapis.com/fantasy/v2/team/' + teamKey + '/roster?format=json',

@@ -81,0 +81,0 @@ apiCallback

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