Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
Commits on Apr 09, 2014
schnie rankings 906e325
Commits on Apr 11, 2014
schnie rearranged mlb arg list d355336
Commits on Apr 16, 2014
@rgerard Merge pull request #5 from Differential/master
NBA Rankings and MLB Argument Order
17becb5
Showing with 37 additions and 11 deletions.
  1. +11 −11 index_mlb.js
  2. +9 −0 index_nba.js
  3. +17 −0 util/url_helper_nba.js
View
22 index_mlb.js
@@ -40,7 +40,7 @@ function getStandings(callback) {
createRequest(url, callback);
}
-function getGameStatistics(callback, event) {
+function getGameStatistics(event, callback) {
var url = urlHelper.getGameStatisticsUrl(event);
createRequest(url, callback);
}
@@ -50,22 +50,22 @@ function getDailyBoxscore(year, month, day, callback) {
createRequest(url, callback);
}
-function getPlayByPlay(callback, event) {
+function getPlayByPlay(event, callback) {
var url = urlHelper.getPlayByPlayUrl(event);
createRequest(url, callback);
}
-function getGameBoxscore(callback, event) {
+function getGameBoxscore(event, callback) {
var url = urlHelper.getGameBoxscoreUrl(event);
createRequest(url, callback);
}
-function getActiveTeamRoster(callback, event) {
+function getActiveTeamRoster(callback) {
var url = urlHelper.getActiveTeamRosterUrl();
createRequest(url, callback);
}
-function getFullTeamRoster(callback, event) {
+function getFullTeamRoster(callback) {
var url = urlHelper.getFullTeamRosterUrl();
createRequest(url, callback);
}
@@ -113,20 +113,20 @@ module.exports = {
return getStandings(callback);
},
- getGameStatistics: function(callback, event) {
- return getGameStatistics(callback, event);
+ getGameStatistics: function(event, callback) {
+ return getGameStatistics(event, callback);
},
getDailyBoxscore: function(year, month, day, callback) {
return getDailyBoxscore(year, month, day, callback);
},
- getPlayByPlay: function(callback, event) {
- return getPlayByPlay(callback, event);
+ getPlayByPlay: function(event, callback) {
+ return getPlayByPlay(event, callback);
},
- getGameBoxscore: function(callback, event) {
- return getGameBoxscore(callback, event);
+ getGameBoxscore: function(event, callback) {
+ return getGameBoxscore(event, callback);
},
getActiveTeamRoster: function(callback) {
View
9 index_nba.js
@@ -51,6 +51,11 @@ function getStandings(callback) {
createRequest(url, callback);
}
+function getRankings(callback) {
+ var url = urlHelper.getRankingsUrl();
+ createRequest(url, callback);
+}
+
function getInjuries(callback) {
var url = urlHelper.getInjuriesUrl();
createRequest(url, callback);
@@ -106,6 +111,10 @@ module.exports = {
return getStandings(callback);
},
+ getRankings: function(callback) {
+ return getRankings(callback);
+ },
+
getInjuries: function(callback) {
return getInjuries(callback);
},
View
17 util/url_helper_nba.js
@@ -82,6 +82,19 @@ function createStandingsUrl() {
+ config.nba.apikey;
}
+function createRankingsUrl() {
+ // URL should look like: http://api.sportsdatallc.org/nba-[access_level][version]/seasontd/[season]/[nba_season]/rankings.xml?api_key=[your_api_key]
+return 'http://api.sportsdatallc.org/nba-'
+ + config.nba.access_level
+ + config.nba.version
+ + '/seasontd/'
+ + config.nba.seasonID
+ + '/'
+ + config.nba.season
+ + '/rankings.xml?api_key='
+ + config.nba.apikey;
+}
+
function createInjuriesUrl() {
// URL should look like: http://api.sportsdatallc.org/nba-[access_level][version]/league/injuries.xml?api_key=[your_api_key]
@@ -126,6 +139,10 @@ module.exports = {
return createStandingsUrl();
},
+ getRankingsUrl: function () {
+ return createRankingsUrl();
+ },
+
getInjuriesUrl: function () {
return createInjuriesUrl();
},

No commit comments for this range

Something went wrong with that request. Please try again.