lolapi 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/configuration.rb +15 -0
- data/lib/lolapi.rb +45 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e7d8bebee5848c3a7da0853ce2af3e1a0ccdab1a
|
4
|
+
data.tar.gz: f2ea8a50c5ac4a590d965069c0bfae87bcdbdcde
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e9f19fe533b208d5082327be7f359c18279b4eef5da207f2bd5aec8bb5b8ea86ad77023084a325a1c69367c403084276f8e9a44116cfef380fdbd1ccb3bddf0c
|
7
|
+
data.tar.gz: 8ee7c6866ad3993035bbaf16f66b216c57ad99c7df5affe7cef185ee6e81fc54fa71f85f81ccb782d476a4421852180125f2c90d01e9a87bcb2eccc2f4924234
|
data/lib/lolapi.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'cgi'
|
3
|
+
require 'json'
|
4
|
+
require 'configuration'
|
5
|
+
class LoLAPI
|
6
|
+
extend Configuration
|
7
|
+
|
8
|
+
def self.champion(region)
|
9
|
+
query '/api/lol/' + region + '/v1.1/champion'
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.game(summoner_id, region)
|
13
|
+
query '/api/lol/' + region + '/v1.1/game/by-summoner/' + summoner_id.to_s + '/recent'
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.league(summoner_id, region)
|
17
|
+
query '/api/' + region + '/v2.1/league/by-summoner/' + summoner_id.to_s
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.summary(summoner_id, region)
|
21
|
+
query '/api/lol/' + region + '/v1.1/stats/by-summoner/' + summoner_id.to_s + '/summary', 'season=SEASON3'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.ranked(summoner_id, region)
|
25
|
+
query '/api/lol/' + region + '/v1.1/stats/by-summoner/' + summoner_id.to_s + '/ranked'
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.summoner(name, region)
|
29
|
+
query '/api/lol/' + region + '/v1.1/summoner/by-name/' + name
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.team(summoner_id, region)
|
33
|
+
query '/api/' + region + '/v2.1/team/by-summoner/' + summoner_id.to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.query(uri, params = nil)
|
37
|
+
if params.nil?
|
38
|
+
response = Net::HTTP.get(URI('http://prod.api.pvp.net' + uri + '?api_key=' + self.api_key))
|
39
|
+
else
|
40
|
+
response = Net::HTTP.get(URI('http://prod.api.pvp.net' + uri + '?' + params + '&api_key=' + self.api_key))
|
41
|
+
end
|
42
|
+
|
43
|
+
JSON.parse(response)
|
44
|
+
end
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lolapi
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ian Mitchell
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-10 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A wrapper for the League of Legends API desc
|
14
|
+
email: ian.mitchel1@live.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/lolapi.rb
|
20
|
+
- lib/configuration.rb
|
21
|
+
homepage: http://github.com/ianmitchell/lolapi
|
22
|
+
licenses: []
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.0.14
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: A wrapper for the League of Legends API
|
44
|
+
test_files: []
|