Created
September 19, 2014 20:20
-
-
Save ciwolsey/d0f716b36e33ceb55be4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Irelia = Npm.require("irelia"); | |
_currentMatches = 0; | |
_currentMatchesListeners = new Tracker.Dependency(); | |
currentLikeCount = function() { | |
_currentMatchesListeners.depend(); | |
return _currentMatches; | |
} | |
Meteor.setInterval(function() { | |
var irelia = new Irelia({ | |
secure: true, | |
host: 'prod.api.pvp.net', | |
path: '/api/lol/', | |
key: '9460577f-34a3-4c59-9a78-c992d92562f9' | |
}); | |
irelia.getSummonerByName('euw', 'i am lee win', function (err, res){ | |
console.log("----------- getSummonerByName ------------"); | |
if (!err && res !== _currentMatches) { | |
console.log("Found update!"); | |
_currentMatches = res; | |
_currentMatches.changed(); | |
} else { | |
console.log("No updates available"); | |
} | |
}); | |
}, 5000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment