pubg-rb 0.1.3 → 0.1.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +27 -20
- data/lib/pubg-rb.rb +0 -1
- data/lib/pubg/client.rb +1 -1
- data/lib/pubg/player.rb +11 -2
- data/lib/pubg/telemetry.rb +1 -1
- data/lib/pubg/version.rb +1 -1
- metadata +2 -3
- data/lib/pubg/players.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 902b2742f3e511539295e0a45dba53ea0526df67
|
4
|
+
data.tar.gz: dcc74ae3902de37d2a912622a82ae54b79904f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59244d54c66eacd1e9cef1c23301ae2d9c8dfaea3ba2ef762c34f8b05fb839f666d248278746fb72fb3877d76991952ed264e7ae117b6b3fd43fd7b89a73ea47
|
7
|
+
data.tar.gz: 720c414a8ad42e9a90679c86476b080557fb3add746e0a68af427177c0f25be4a95847a309285762bf72b1c4520add02048e53f259a0a4893b3dc1d14d6db75b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,6 +4,8 @@ Wraps the PUBG REST API for convenient access from ruby applications.
|
|
4
4
|
|
5
5
|
Documentation for the PUBG REST API can be found here: [https://documentation.playbattlegrounds.com/en/introduction.html](https://documentation.playbattlegrounds.com/en/introduction.html)
|
6
6
|
|
7
|
+
Notice this wrapper is still in development. Im sure some things are broken when dealing with PC match data. Ive been testing using an xbox account.
|
8
|
+
|
7
9
|
## Installation
|
8
10
|
To install using [Bundler](https://bundler.io/) grab the latest stable version:
|
9
11
|
|
@@ -31,7 +33,7 @@ make install
|
|
31
33
|
```
|
32
34
|
## Getting Started
|
33
35
|
### Setup Work
|
34
|
-
```
|
36
|
+
```ruby
|
35
37
|
require "pubg-rb"
|
36
38
|
|
37
39
|
# put your own credentials here
|
@@ -43,10 +45,10 @@ platform_region = "xbox-na"
|
|
43
45
|
```
|
44
46
|
|
45
47
|
### Make a Call
|
46
|
-
an example for getting the
|
48
|
+
an example for getting the status
|
47
49
|
|
48
|
-
```
|
49
|
-
@pubg.
|
50
|
+
```ruby
|
51
|
+
@pubg.status
|
50
52
|
```
|
51
53
|
|
52
54
|
---
|
@@ -56,18 +58,19 @@ an example for getting the seasons
|
|
56
58
|
### -CLIENT
|
57
59
|
Set up a client to talk to the PUBG API.
|
58
60
|
|
59
|
-
```
|
61
|
+
```ruby
|
60
62
|
@pubg = PUBG::Client.new("api_key", "platform_region")
|
61
63
|
```
|
62
|
-
- note if platform_region is set on the client it does not need to be set elsewhere
|
64
|
+
- note if `platform_region` is set on the client or environment variable`PUBG_PLATFORM_REGION` it does not need to be set elsewhere
|
63
65
|
|
64
66
|
### -PLAYERS
|
65
67
|
##### /players
|
66
68
|
Get a collection of players by name's.
|
67
69
|
|
68
|
-
```
|
69
|
-
players = @pubg.players("acidtib,ImAverageSniper")
|
70
|
+
```ruby
|
71
|
+
players = @pubg.players("Optional_platform_region", "acidtib,ImAverageSniper")
|
70
72
|
|
73
|
+
players.original
|
71
74
|
players.data
|
72
75
|
players.links
|
73
76
|
players.meta
|
@@ -75,9 +78,10 @@ players.meta
|
|
75
78
|
|
76
79
|
Get a collection of players by player_id's.
|
77
80
|
|
78
|
-
```
|
79
|
-
players = @pubg.players("account.c975e15685614c5f9da44f25598f7670,account.c6d7393a0fed4613973e3d89582f23fc")
|
81
|
+
```ruby
|
82
|
+
players = @pubg.players("Optional_platform_region", "account.c975e15685614c5f9da44f25598f7670,account.c6d7393a0fed4613973e3d89582f23fc")
|
80
83
|
|
84
|
+
players.original
|
81
85
|
players.data
|
82
86
|
players.links
|
83
87
|
players.meta
|
@@ -86,9 +90,10 @@ players.meta
|
|
86
90
|
##### /players/{player_id}
|
87
91
|
Get a single player by the `player_id`.
|
88
92
|
|
89
|
-
```
|
90
|
-
player = @pubg.player("account.c975e15685614c5f9da44f25598f7670")
|
93
|
+
```ruby
|
94
|
+
player = @pubg.player("Optional_platform_region", "account.c975e15685614c5f9da44f25598f7670")
|
91
95
|
|
96
|
+
player.original
|
92
97
|
player.data
|
93
98
|
player.links
|
94
99
|
player.meta
|
@@ -101,9 +106,10 @@ player.season("division.bro.official.xb-pre1")
|
|
101
106
|
##### /players/{player_id}/seasons/{season_id}
|
102
107
|
Get season information for a single player.
|
103
108
|
|
104
|
-
```
|
109
|
+
```ruby
|
105
110
|
season = player.season("xbox-na", "division.bro.official.xb-pre1")
|
106
111
|
|
112
|
+
season.original
|
107
113
|
season.data
|
108
114
|
season.links
|
109
115
|
season.meta
|
@@ -112,7 +118,7 @@ season.meta
|
|
112
118
|
### -MATCHES
|
113
119
|
#### /matches/{match_id}
|
114
120
|
|
115
|
-
```
|
121
|
+
```ruby
|
116
122
|
match = @pubg.match("895e77a8-0efa-492b-b256-3e9bf79097e6")
|
117
123
|
|
118
124
|
match.data
|
@@ -128,20 +134,21 @@ match.roster
|
|
128
134
|
##### /status
|
129
135
|
Check the status of the API.
|
130
136
|
|
131
|
-
```
|
137
|
+
```ruby
|
132
138
|
status = @pubg.status
|
133
139
|
|
140
|
+
status.original
|
134
141
|
status.data
|
135
|
-
status.attributes
|
136
142
|
```
|
137
143
|
|
138
144
|
### -SEASONS
|
139
145
|
##### /seasons
|
140
146
|
Get a list of available seasons.
|
141
147
|
|
142
|
-
```
|
143
|
-
seasons = @pubg.seasons
|
148
|
+
```ruby
|
149
|
+
seasons = @pubg.seasons("Optional_platform_region")
|
144
150
|
|
151
|
+
seasons.original
|
145
152
|
seasons.data
|
146
153
|
seasons.links
|
147
154
|
seasons.meta
|
@@ -150,10 +157,10 @@ seasons.meta
|
|
150
157
|
### -TELEMETRY
|
151
158
|
Telemetry provides further insight into a match.
|
152
159
|
|
153
|
-
```
|
160
|
+
```ruby
|
154
161
|
telemetry = @pubg.telemetry("https://telemetry-cdn...c30c-telemetry.json")
|
155
162
|
|
156
|
-
telemetry.
|
163
|
+
telemetry.original
|
157
164
|
telemetry.playerLogin
|
158
165
|
telemetry.playerCreate
|
159
166
|
telemetry.playerPosition
|
data/lib/pubg-rb.rb
CHANGED
data/lib/pubg/client.rb
CHANGED
@@ -29,7 +29,7 @@ module PUBG
|
|
29
29
|
params = "?filter[playerNames]=#{items}"
|
30
30
|
end
|
31
31
|
path = "/shards/#{platform_region}/players#{params}"
|
32
|
-
PUBG::
|
32
|
+
PUBG::Player.new(Client.request(path), true)
|
33
33
|
end
|
34
34
|
|
35
35
|
def match(platform_region=$platform_region, match_id)
|
data/lib/pubg/player.rb
CHANGED
@@ -5,7 +5,8 @@ module PUBG
|
|
5
5
|
require "pubg/player/matches"
|
6
6
|
require "pubg/player/season"
|
7
7
|
|
8
|
-
def initialize(args)
|
8
|
+
def initialize(args, s=false)
|
9
|
+
@s = s
|
9
10
|
@args = args
|
10
11
|
end
|
11
12
|
|
@@ -14,7 +15,15 @@ module PUBG
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def data
|
17
|
-
|
18
|
+
if @s
|
19
|
+
data = []
|
20
|
+
@args["data"].each do |player|
|
21
|
+
data << Data.new(player)
|
22
|
+
end
|
23
|
+
return data
|
24
|
+
else
|
25
|
+
Data.new(@args["data"])
|
26
|
+
end
|
18
27
|
end
|
19
28
|
|
20
29
|
def links
|
data/lib/pubg/telemetry.rb
CHANGED
data/lib/pubg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubg-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dainel Vera
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -181,7 +181,6 @@ files:
|
|
181
181
|
- lib/pubg/player/season/data/relationships/player.rb
|
182
182
|
- lib/pubg/player/season/data/relationships/season.rb
|
183
183
|
- lib/pubg/player/season/data/stats.rb
|
184
|
-
- lib/pubg/players.rb
|
185
184
|
- lib/pubg/pub_error.rb
|
186
185
|
- lib/pubg/seasons.rb
|
187
186
|
- lib/pubg/seasons/data.rb
|