Code Monkey home page Code Monkey logo

irelia's Introduction

Irelia

Travis Status

Irelia is a Node.js Wrapper that will allow you to start coding easily with the League of Legends Oficial API.

Get your API Key at http://developer.riotgames.com

There are API limits right now, so use the API with caching with Redis, Memcache, etc.

Installation

npm install irelia

Usage

var Irelia = require('irelia');
var irelia = new Irelia({
	secure: true,
	key: 'your_key_goes_here',
	debug: true
});
irelia.getSummonerByName('euw', 'NSZombie', function (err, res){
	console.log(err, res);
});

Errors

var Irelia = require('irelia');
var irelia = new Irelia({
	secure: true,
	key: 'your_key_goes_here',
	debug: true
});
irelia.getSummonerByName('euw', 'NSZombie', function (err, summoner){
	if(err){
		if(err.status){
			if(err.status.code == 429){
				console.log(err.status.message);
			} else if(err.status.code == 404){
				console.log(err.status.message);
			} else if(err.status.code == 500){
				console.log(err.status.message);
			} else {
				console.log('Unknown error code');
			}
		} else {
			console.log(err); // Non http error
		}
	} else {
		console.log(summoner);
	}
});

Constants

  • lol.regions['euw'] -> 'Europe West'
  • lol.queues[2] -> 'Normal 5v5 Blind Pick'
  • lol.gametypes['CUSTOM_GAME'] -> 'Custom game'
  • lol.gamemode['CLASSIC'] -> 'Summoner's Rift/Twisted Treeline game'

Methods

Callbacks - Response is given asyncronly using callbacks.

irelia.getChampions('euw', true, function (err, champions){
	console.log(err, champions);
});
  • irelia.getChampions(region, freeToPlay[optional], callback);
  • irelia.getRecentGamesBySummonerId(region, summonerId, callback);
  • irelia.getLeagueBySummonerId(region, summonerId, callback);
  • irelia.getLeagueEntryBySummonerId(region, summonerId, callback);
  • irelia.getChallengerLeagueByGametype(region, type[example'RANKED_SOLO_5X5'])
  • irelia.getSummaryStatsBySummonerId(region, summonerId, season [optional], callback);
  • irelia.getRankedStatsBySummonerId(region, summonerId, season [optional], callback);
  • irelia.getMasteriesBySummonerId(region, summonerId, callback);
  • irelia.getRunesBySummonerId(region, summonerId, callback);
  • irelia.getSummonerByName(region, name, callback);
  • irelia.getSummonerBySummonerId(region, summonerId, callback);
  • irelia.getSummonersBySummonerIds(region, summonerIds[Array list], callback);
  • irelia.getTeamsBySummonerId(region, summonerId, callback);
  • irelia.getChampions(region, true, callback);
  • irelia.getRecentGamesByAccountId(region, accountId, callback);
  • irelia.getChampionMastery(region, summonerId, championId, callback);
  • irelia.getLeagueEntryBySummonerId(region, summonerId, callback);
  • irelia.getSummonerByName(region, name, callback);
  • irelia.getStatus(region, callback);
  • irelia.getMatchByMatchId(region, matchId, callback);
  • irelia.getTotalChampionMasteries(region, summonerId, callback);

Stats

  • irelia.getRealms(region, callback);
  • irelia.getRunes(version, locale, callback);
  • irelia.getMasteries(version, locale, callback);
  • irelia.getItems(version, locale, callback);
  • irelia.getChampionsData(version, locale, callback);
  • irelia.getSummonerSpells(version, locale, callback);
  • irelia.getLanguage(version, locale, callback);

irelia's People

Contributors

talha-t avatar perezpaya avatar anujan avatar gotbadger avatar skzap avatar

Stargazers

Brayam Valero avatar Luke Hardiman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.