hypixel-ruby 0.0.1 → 0.0.4
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 +5 -5
- data/lib/hypixel-ruby.rb +15 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 098b28c3fac80807736392861e1ce69f0331962256a60f953acfb3c90157aabc
|
4
|
+
data.tar.gz: 32e7cff639ce3ba34ea580c39fd41f21cacda30ed97ef401633d12b5966618a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecc973fbcda49edc6aca6aa8f82bf29eaf3cea2007dabac0310ac18ab10f557fbb77451afbfac17840e3813137ecc1b4438a273a15d176a37590a3d2c997bc92
|
7
|
+
data.tar.gz: f0dd0b79824fe32ba4634480dddb8897852c9e0ec194fa6523ebdb7e81f0e85aedffc65dceda9e77a235374334660fde962c0265b83a3a302d4eaa9bea4aa875
|
data/lib/hypixel-ruby.rb
CHANGED
@@ -1,15 +1,21 @@
|
|
1
1
|
require 'open-uri'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
+
# Base object for the api. Only create one for the entire build as it will one day keep track of your request limits. *All methods are avaible at https://github.com/HypixelDev/PublicAPI/tree/master/Documentation/methods, use arguments are parms.*
|
4
5
|
class HypixelAPI
|
5
6
|
|
7
|
+
# Parses url to Rubyfiy the request, internal so you won't need to use it for much.
|
6
8
|
def fetch(url)
|
7
9
|
source = (open URI(url)).read
|
8
10
|
return JSON.parse(source, :symbolize_names => true)
|
9
11
|
end
|
12
|
+
|
13
|
+
# Creates a new object with your API key. *If request are failing for you, remember to check your key.*
|
10
14
|
def initialize(key)
|
11
15
|
@key = key
|
12
16
|
end
|
17
|
+
|
18
|
+
# Builds a url from the request type and parameters. *Do not specify your key in the parameters.*
|
13
19
|
def url(type, hash)
|
14
20
|
url = "https://api.hypixel.net/"
|
15
21
|
url << type.to_s
|
@@ -28,30 +34,37 @@ class HypixelAPI
|
|
28
34
|
# ex: api.player( :uuid => "<uuid here>" )
|
29
35
|
#
|
30
36
|
|
37
|
+
# Fetches boosters and their active times.
|
31
38
|
def boosters(args={})
|
32
39
|
fetch(url(:"boosters", args))
|
33
40
|
end
|
34
41
|
|
42
|
+
# Finds a guild by name or player.
|
35
43
|
def findguild(args={})
|
36
44
|
fetch(url(:"findguild", args))
|
37
45
|
end
|
38
46
|
|
47
|
+
# Refer to PublicAPI docs on this one.
|
39
48
|
def friends(args={})
|
40
49
|
fetch(url(:"friends", args))
|
41
50
|
end
|
42
51
|
|
52
|
+
# Fetches guild data by id.
|
43
53
|
def guild(args={})
|
44
54
|
fetch(url(:"guild", args))
|
45
55
|
end
|
46
56
|
|
57
|
+
# Fetches info about current status of API key.
|
47
58
|
def key(args={})
|
48
59
|
fetch(url(:"key", args))
|
49
60
|
end
|
50
61
|
|
62
|
+
# Gets top players in each game.
|
51
63
|
def leaderboards(args={})
|
52
64
|
fetch(url(:"leaderboards", args))
|
53
65
|
end
|
54
66
|
|
67
|
+
# Fetches player, recommended that you webscrape for uuid before finding them.
|
55
68
|
def player(args={})
|
56
69
|
fetch(url(:"player", args))
|
57
70
|
end
|
@@ -60,8 +73,9 @@ class HypixelAPI
|
|
60
73
|
fetch(url(:"session", args))
|
61
74
|
end
|
62
75
|
|
76
|
+
# Gets info on bans/watchdog.
|
63
77
|
def watchdogstats(args={})
|
64
78
|
fetch(url(:"watchdogstats", args))
|
65
79
|
end
|
66
80
|
|
67
|
-
end
|
81
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hypixel-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PenguinOwl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Coming Soon
|
14
14
|
email:
|
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
39
|
rubyforge_project:
|
40
|
-
rubygems_version: 2.6
|
40
|
+
rubygems_version: 2.7.6
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
43
|
summary: Barebones wrapper for hyixel stats
|