Giter Site home page Giter Site logo

viktor's Introduction

Build Status Inline docs

Viktor

"Function over form."

Viktor is an Elixir interface to Riot Games' League of Legends API named after a character in the game.

Prerequisite

"Join the glorious evolution."

Sign up for an API key at Riot Games Developer site.

Installation

"Pave the way."

Add viktor to your list of dependencies in mix.exs:

def deps do
  [{:viktor, "~> 0.0.8"}]
end

Ensure viktor is started before your application:

def application do
  [applications: [:viktor]]
end

Test in iex:

mix deps.get
iex -S mix

Usage

Set the RIOT_API_KEY environment variable.

export RIOT_API_KEY=whatever_key_rito_assigned_you

Viktor uses Elixir's Agent to manage the API key between requests, so you must call start_link/0.

If RIOT_API_KEY is set

Viktor.start_link

You may also set the key using start_link/1

Viktor.start_link("whatever_key_rito_assigned_you")

Examples

I'm in the process of making this a little more pleasant by providing the functions off the root module. These examples will work, but see the documentation for details.

Viktor.start_link
champion_list = Viktor.champions("na")
champion_list_free_week = Viktor.champions("na", true)
champion_by_id = Viktor.champion("na", 1)
champion_mastery_score = Viktor.mastery_score("na", 21066)
champion_mastery_champion = Viktor.champion_mastery("na", 21066, 1)
champion_mastery_champions = Viktor.champion_masteries("na", 21066)
champion_mastery_3_topchampions = Viktor.top_champion_masteries("na", 21066)
champion_mastery_5_topchampions = Viktor.top_champion_masteries("na", 21066, 5)
current_game = Viktor.current_game("na", 21066)
featured_games = Viktor.featured_games("na")

All that's left are the tournament endpoints!

Other API Libraries

Be sure to check out the other libraries out there!

velkoz

viktor's People

Contributors

josephyi avatar

Watchers

 avatar  avatar  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.