Skip to content

Instantly share code, notes, and snippets.

@ciwolsey
Created September 19, 2014 20:20
Show Gist options
  • Save ciwolsey/d0f716b36e33ceb55be4 to your computer and use it in GitHub Desktop.
Save ciwolsey/d0f716b36e33ceb55be4 to your computer and use it in GitHub Desktop.
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