roccodev-api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/histo.rb +28 -0
- data/lib/monthlies.rb +28 -0
- data/lib/roccodev-api.rb +5 -0
- data/lib/streaks.rb +28 -0
- data/roccodev-api.gemspec +9 -0
- metadata +47 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8f393a74b2b0e569357b591fdc041308ff4984008fbcee0c30d5cda277b3abf6
|
4
|
+
data.tar.gz: e4953a595f8caa33ac30314c45b869cd480b52a8b0c284ec39a56d84a12394c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f732e6cdfe362e46ed35ab509afae21228086234a83e5880054695535b79cfda93a128dcc73ea626633a343343ecf0f1a84f348221cf8fa6d02c92fe66e8b4b1
|
7
|
+
data.tar.gz: aff1e39feaece7b472c5635a2d2b234e81a5137afd7ba1f226874b78d760d05aceeb60dab874c1be5775ae75ec8050ab128b315a3a0aaa0ae41203e7b0ce0110
|
data/lib/histo.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class HistoricalWinstreaks
|
5
|
+
|
6
|
+
def initialize(game)
|
7
|
+
@game = game
|
8
|
+
end
|
9
|
+
|
10
|
+
def leaderboard(*args)
|
11
|
+
if args.length == 2
|
12
|
+
url = "https://api.roccodev.pw/#{@game}/winstreaks/historical/leaderboard?from=#{args[0]}&to=#{args[1]}"
|
13
|
+
else
|
14
|
+
url = "https://api.roccodev.pw/#{@game}/winstreaks/historical/leaderboard"
|
15
|
+
end
|
16
|
+
uri = URI(url)
|
17
|
+
res = Net::HTTP.get(uri)
|
18
|
+
return JSON.parse(res)
|
19
|
+
end
|
20
|
+
|
21
|
+
def profile(uuid)
|
22
|
+
url = "https://api.roccodev.pw/#{@game}/winstreaks/historical/profile/#{uuid}"
|
23
|
+
uri = URI(url)
|
24
|
+
res = Net::HTTP.get(uri)
|
25
|
+
return JSON.parse(res)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/lib/monthlies.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Monthlies
|
5
|
+
|
6
|
+
def initialize(game)
|
7
|
+
@game = game
|
8
|
+
end
|
9
|
+
|
10
|
+
def leaderboard(*args)
|
11
|
+
if args.length == 2
|
12
|
+
url = "https://api.roccodev.pw/#{@game}/monthlies/leaderboard?from=#{args[0]}&to=#{args[1]}"
|
13
|
+
else
|
14
|
+
url = "https://api.roccodev.pw/#{@game}/monthlies/leaderboard"
|
15
|
+
end
|
16
|
+
uri = URI(url)
|
17
|
+
res = Net::HTTP.get(uri)
|
18
|
+
return JSON.parse(res)
|
19
|
+
end
|
20
|
+
|
21
|
+
def profile(uuid)
|
22
|
+
url = "https://api.roccodev.pw/#{@game}/monthlies/profile/#{uuid}"
|
23
|
+
uri = URI(url)
|
24
|
+
res = Net::HTTP.get(uri)
|
25
|
+
return JSON.parse(res)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/lib/roccodev-api.rb
ADDED
data/lib/streaks.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class Winstreaks
|
5
|
+
|
6
|
+
def initialize(game)
|
7
|
+
@game = game
|
8
|
+
end
|
9
|
+
|
10
|
+
def leaderboard(*args)
|
11
|
+
if args.length == 2
|
12
|
+
url = "https://api.roccodev.pw/#{@game}/winstreaks/leaderboard?from=#{args[0]}&to=#{args[1]}"
|
13
|
+
else
|
14
|
+
url = "https://api.roccodev.pw/#{@game}/winstreaks/leaderboard"
|
15
|
+
end
|
16
|
+
uri = URI(url)
|
17
|
+
res = Net::HTTP.get(uri)
|
18
|
+
return JSON.parse(res)
|
19
|
+
end
|
20
|
+
|
21
|
+
def profile(uuid)
|
22
|
+
url = "https://api.roccodev.pw/#{@game}/winstreaks/profile/#{uuid}"
|
23
|
+
uri = URI(url)
|
24
|
+
res = Net::HTTP.get(uri)
|
25
|
+
return JSON.parse(res)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "roccodev-api"
|
3
|
+
s.version = "1.0.0"
|
4
|
+
s.date = %q{2018-12-19}
|
5
|
+
s.authors = "RoccoDev"
|
6
|
+
s.summary = "Ruby wrapper for RoccoDev's API"
|
7
|
+
s.files = Dir['**/*'].keep_if { |file| File.file?(file) }
|
8
|
+
s.require_paths = ["lib"]
|
9
|
+
end
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: roccodev-api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- RoccoDev
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/histo.rb
|
20
|
+
- lib/monthlies.rb
|
21
|
+
- lib/roccodev-api.rb
|
22
|
+
- lib/streaks.rb
|
23
|
+
- roccodev-api.gemspec
|
24
|
+
homepage:
|
25
|
+
licenses: []
|
26
|
+
metadata: {}
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 2.7.6
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: Ruby wrapper for RoccoDev's API
|
47
|
+
test_files: []
|