hockeystreams v1.0.0
__ __ __
/ /_ ____ _____/ /_____ __ _______/ /_________ ____ _____ ___ _____
/ __ \/ __ \/ ___/ //_/ _ \/ / / / ___/ __/ ___/ _ \/ __ `/ __ `__ \/ ___/
/ / / / /_/ / /__/ ,< / __/ /_/ (__ ) /_/ / / __/ /_/ / / / / / (__ )
/_/ /_/\____/\___/_/|_|\___/\__, /____/\__/_/ \___/\__,_/_/ /_/ /_/____/
/____/hockeystreams
A node.js wrapper for the HockeySteams API.
Install
npm i --save hockeystreamsRequirements
API Key
The HockeyStreams API requires an API Key which can be obtained here.
Documentation
Functions
initlogingetLivegetLiveStreamgetLocationsgetOnDemandDatesgetOnDemandgetOnDemandStreamgetHighlightsgetCondensedGameslistTeamsscores
Functions
init(options)
Initializes the HockeyStreams API wrapper. The methods returned will depend on which keys are passed as options.
NOTE: Keys can be obtained on the HockeyStreams API page.
Arguments
options- An Object containingkeyand/orscores_key.
Examples
var HS = require('hockeystreams').init({
key: 'YOUR HOCKEYSTREAMS API KEY',
scores_key: 'YOUR HOCKEYSTREAMS SCORES API KEY'
});login(options, callback)
Authenticates a user, and returns their membership status, as well as a authentication token to use for retrieving the rest of the resources.
Arguments
options- An Object containingusernameandpassword.callback- A Function witherrorandresponsearguments.
Examples
HS.login({
username: 'USERS USERNAME',
password: 'USERS PASSWORD'
}, function(err, res){
// Do your thing
});getLive(options, callback)
Retrieve a list of live streams.
Arguments
options- An Object containing a usertokenand optionally adate.callback- A Function witherrorandresponsearguments.
Examples
HS.getLive({
date: 'MM/DD/YYY', // => Optional
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});getLiveStream(options, callback)
Retrieve a specific live stream, with sources (iStream, WMV and Flash).
Arguments
options- An Object containing an live gameid, a usertokenand optionally alocation.callback- A Function witherrorandresponsearguments.
Examples
HS.getLiveStream({
id: '12345', // => Required
location: 'North America - East Canada', // => Optional
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});getLocations(callback)
Retrieve a list of availalbe streaming locations for live streams.
Arguments
callback- A Function witherrorandresponsearguments.
Examples
HS.getLocations(function(err, res){
// Do your thing
});getOnDemandDates(options, callback)
Retrieve a list of dates where on demand feeds are available.
Arguments
options- An Object containing a usertoken.callback- A Function witherrorandresponsearguments.
Examples
HS.getOnDemandDates({
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});getOnDemand(options, callback)
Retrieve a list of on demand streams.
Arguments
options- An Object containing a usertokenand optionally adateand/or ateam.callback- A Function witherrorandresponsearguments.
Examples
HS.getOnDemand({
date: 'MM/DD/YYYY', // => Optional
team: 'Ottawa Senators', // => Optional
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});getOnDemandStream(options, callback)
Retrieve a specific on demand stream, with sources (iStream, WMV and Flash).
Arguments
options- An Object containing an on-demandid, a usertokenand optionally alocation.callback- A Function witherrorandresponsearguments.
Examples
HS.getOnDemandStream({
id: '12345', // => Required
location: 'North America - East Canada', // => Optional
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});getHighlights(options, callback)
Retrieve a list of highlights.
Arguments
options- An Object containing a usertokenand optionally adateand/or ateam.callback- A Function witherrorandresponsearguments.
Examples
HS.getHighlights({
date: 'MM/DD/YYYY', // => Optional
team: 'Ottawa Senators', // => Optional
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});getCondensedGames(options, callback)
Retrieve a list of condensed games.
Arguments
options- An Object containing a usertokenand optionally adateand/or ateam.callback- A Function witherrorandresponsearguments.
Examples
HS.getCondensedGames({
date: 'MM/DD/YYYY', // => Optional
team: 'Ottawa Senators', // => Optional
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});listTeams(options, callback)
Get a list of all previous live or on-demand teams.
Arguments
options- An Object containing a usertokenand optionally aleague.callback- A Function witherrorandresponsearguments.
Examples
HS.listTeams({
league: 'NHL', // => Optional
token: 'USER TOKEN' // => Retrieved from login method
}, function(err, res){
// Do your thing
});scores(options, callback)
Scores API.
Arguments
options- An Object containing a scores apikeyand optionally adateand/orevent.callback- A Function witherrorandresponsearguments.
Examples
HS.scores({
date: 'MM/DD/YYYY', // => Optional
'event': 'NHL' // => Optional
}, function(err, res){
// Do your thing
});