dota 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +83 -71
- data/lib/dota/api/friend.rb +1 -1
- data/lib/dota/api/match.rb +40 -0
- data/lib/dota/version.rb +1 -1
- data/spec/dota/api/friend_spec.rb +1 -1
- data/spec/dota/api/match_spec.rb +40 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a62df441130d34cd7256896d37e5c526200ab22
|
4
|
+
data.tar.gz: 5d7c27f983e4d0691a2e93d33fac19d21c41717c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b13d19087f4d133e1c5ca03963bd7d4e198501bb41406435f1ee91241363a7d5309ef82c76ccd6c01dadec9ea729701bb61b147a6b5877779665c98dc1b59b5
|
7
|
+
data.tar.gz: 36ad9a1554a4ca7e2fa974cf1ea793863f141f87aafcc34d66e1e5bb211cf4621cbab7551e8778a8bfccb63fd5f46376067ed233ea7126ed223f3580f0819598
|
data/README.md
CHANGED
@@ -61,40 +61,40 @@ Get your Steam API key [here](http://steamcommunity.com/dev/apikey).
|
|
61
61
|
```ruby
|
62
62
|
api = Dota.api
|
63
63
|
|
64
|
-
api.heroes(43) # (Cached) A single hero - "Death Prophet"
|
65
|
-
api.heroes # (Cached) All heroes
|
64
|
+
api.heroes(43) # => (Cached) A single hero - "Death Prophet"
|
65
|
+
api.heroes # => (Cached) All heroes
|
66
66
|
|
67
|
-
api.items(114) # (Cached) A single item - "Heart of Tarrasque"
|
68
|
-
api.items # (Cached) All items
|
67
|
+
api.items(114) # => (Cached) A single item - "Heart of Tarrasque"
|
68
|
+
api.items # => (Cached) All items
|
69
69
|
|
70
|
-
api.cosmetic_rarities # All cosmetic rarities
|
70
|
+
api.cosmetic_rarities # => All cosmetic rarities
|
71
71
|
|
72
|
-
api.teams(1375614) # A single team - "Newbee"
|
73
|
-
api.teams # A list of teams
|
74
|
-
api.teams(after: 1375614) #
|
72
|
+
api.teams(1375614) # => A single team - "Newbee"
|
73
|
+
api.teams # => A list of teams
|
74
|
+
api.teams(after: 1375614) # Allowed options:
|
75
75
|
#
|
76
|
-
#
|
77
|
-
#
|
76
|
+
# :after - Integer, With team IDs equal or greater than this
|
77
|
+
# :limit - Integer, Amount of teams to return (default is 100)
|
78
78
|
|
79
|
-
api.leagues # All leagues
|
79
|
+
api.leagues # => All leagues
|
80
80
|
|
81
|
-
api.matches(789645621) # A single match - "Newbee vs Vici Gaming"
|
82
|
-
api.matches # A list of matches
|
83
|
-
api.matches(hero_id: 43) #
|
81
|
+
api.matches(789645621) # => A single match - "Newbee vs Vici Gaming"
|
82
|
+
api.matches # => A list of matches
|
83
|
+
api.matches(hero_id: 43) # Allowed options:
|
84
84
|
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
|
97
|
-
api.friends(76561198052976237) # All friends of user
|
85
|
+
# :hero_id - Integer, With this hero. See Dota::API::Hero::MAPPING
|
86
|
+
# :after - Integer, With match IDs equal or greater than this
|
87
|
+
# :player_id - Integer, With this player (32-bit Steam ID)
|
88
|
+
# :league_id - Integer, In this league. Use Dota.leagues to get a list of leagues
|
89
|
+
# :mode_id - Integer, In this game mode. See Dota::API::Match::MODES
|
90
|
+
# :skill_level - Integer, In this skill level (ignored if :player_id is provided). See Dota::API::Match::SKILL_LEVELS
|
91
|
+
# :from - Integer, Minimum timestamp
|
92
|
+
# :to - Integer, Maximum timestamp
|
93
|
+
# :min_players - Integer, With at least this number of players
|
94
|
+
# :league_only - Boolean, Only league matches
|
95
|
+
# :limit - Integer, Amount of matches to return (default is 100)
|
96
|
+
|
97
|
+
api.friends(76561198052976237) # => All friends of user
|
98
98
|
```
|
99
99
|
|
100
100
|
#### Custom Requests
|
@@ -155,51 +155,63 @@ Caveat: Getting a list of matches via `api.matches` will call [GetMatchHistory](
|
|
155
155
|
When an instance method in a `Dota::API::Match` class returns `nil`, it most likely means the endpoint called doesn't provide it yet.
|
156
156
|
|
157
157
|
```ruby
|
158
|
-
match.id #
|
159
|
-
match.league_id #
|
160
|
-
match.type #
|
161
|
-
match.type_id #
|
162
|
-
match.mode #
|
163
|
-
match.mode_id #
|
164
|
-
match.
|
165
|
-
match.
|
166
|
-
match.
|
167
|
-
match.
|
168
|
-
match.
|
169
|
-
match.
|
170
|
-
match.
|
171
|
-
match.
|
172
|
-
match.
|
173
|
-
match.
|
174
|
-
match.
|
175
|
-
match.
|
176
|
-
|
177
|
-
match.
|
178
|
-
match.
|
179
|
-
match.
|
158
|
+
match.id # Integer, ID of the match
|
159
|
+
match.league_id # Integer, ID of the league this match was a part of
|
160
|
+
match.type # String, See Dota::API::Match::TYPES
|
161
|
+
match.type_id # Integer, See Dota::API::Match::TYPES
|
162
|
+
match.mode # String, See Dota::API::Match::MODES
|
163
|
+
match.mode_id # Integer, See Dota::API::Match::MODES
|
164
|
+
match.sequence # Integer, A 'sequence number', representing the order in which matches were recorded
|
165
|
+
match.season # Integer, Season the match was played in
|
166
|
+
match.cluster # Integer, Server cluster the match was played on
|
167
|
+
match.drafts # Array[Dota::API::Match::Draft], Picks and bans in the match, if the game mode is "Captains Mode"
|
168
|
+
match.players # Array[Dota::API::Match::Player], Players in the match
|
169
|
+
match.players_count # Integer, Number of players in the match
|
170
|
+
match.starts_at # Time, When the match started
|
171
|
+
match.first_blood # Integer, Seconds since the match started when first blood occured
|
172
|
+
match.duration # Integer, Length of the match, in seconds since the match began.
|
173
|
+
match.winner # Symbol, :radiant or :dire
|
174
|
+
match.positive_votes # Integer, Number of thumbs-up the game has received
|
175
|
+
match.negative_votes # Integer, Number of thumbs-down the game has received
|
176
|
+
|
177
|
+
match.radiant_id # Integer, Radiant team's ID
|
178
|
+
match.radiant_captain_id # Integer, Radiant captain's ID
|
179
|
+
match.radiant_logo_id # Integer, Radiant logo's UGC ID
|
180
|
+
match.radiant_name # String, Radiant team's name
|
181
|
+
match.radiant_complete? # Boolean, true if the Radiant team's roster is complate
|
182
|
+
match.radiant_tower_status # Integer, See https://wiki.teamfortress.com/wiki/WebAPI/GetMatchDetails # Tower_Status
|
183
|
+
match.radiant_barracks_status # Integer, See https://wiki.teamfortress.com/wiki/WebAPI/GetMatchDetails # Barracks_Status
|
184
|
+
|
185
|
+
match.dire_id # Integer, Dire team's ID
|
186
|
+
match.dire_captain_id # Integer, Dire captain's ID
|
187
|
+
match.dire_logo_id # Integer, Dire logo's UGC ID
|
188
|
+
match.dire_name # String, Dire team's name
|
189
|
+
match.dire_complete? # Boolean, true if the Dire team's roster is complate
|
190
|
+
match.dire_tower_status # Integer, See https://wiki.teamfortress.com/wiki/WebAPI/GetMatchDetails # Tower_Status
|
191
|
+
match.dire_barracks_status # Integer, See https://wiki.teamfortress.com/wiki/WebAPI/GetMatchDetails # Barracks_Status
|
180
192
|
```
|
181
193
|
|
182
194
|
#### Players
|
183
195
|
|
184
196
|
```ruby
|
185
|
-
player.id #
|
186
|
-
player.hero #
|
187
|
-
player.items #
|
188
|
-
player.slot #
|
189
|
-
player.status #
|
190
|
-
player.level #
|
191
|
-
player.kills #
|
192
|
-
player.deaths #
|
193
|
-
player.assists #
|
194
|
-
player.last_hits #
|
195
|
-
player.denies #
|
196
|
-
player.gold #
|
197
|
-
player.gold_spent #
|
198
|
-
player.gpm #
|
199
|
-
player.xpm #
|
200
|
-
player.hero_damage #
|
201
|
-
player.tower_damage #
|
202
|
-
player.hero_healing #
|
197
|
+
player.id # Integer, 32-bit Steam ID
|
198
|
+
player.hero # Dota::API::Hero, Player's hero
|
199
|
+
player.items # Array[Dota::API::Item], Player's inventory (6 items)
|
200
|
+
player.slot # Integer, See https://wiki.teamfortress.com/wiki/WebAPI/GetMatchDetails#Player_Slot
|
201
|
+
player.status # Symbol, :played, :left_safe, :abandoned, or :bot
|
202
|
+
player.level # Integer, The player's level at match end
|
203
|
+
player.kills # Integer, Number of kills attributed to this player
|
204
|
+
player.deaths # Integer, Times this player died during the match
|
205
|
+
player.assists # Integer, Number of assists the player got
|
206
|
+
player.last_hits # Integer, Number of last-hits the player got
|
207
|
+
player.denies # Integer, Number of denies the player got
|
208
|
+
player.gold # Integer, Amount of gold the player had remaining at the end of the match
|
209
|
+
player.gold_spent # Integer, Amount of gold the player spent
|
210
|
+
player.gpm # Integer, Player's overall gold/minute
|
211
|
+
player.xpm # Integer, Player's overall experience/minute
|
212
|
+
player.hero_damage # Integer, Amount of damage the player dealt to heroes
|
213
|
+
player.tower_damage # Integer, Amount of damage the player dealt to towers
|
214
|
+
player.hero_healing # Integer, Amount of health the player had healed on heroes
|
203
215
|
```
|
204
216
|
|
205
217
|
#### Drafts
|
@@ -208,7 +220,7 @@ player.hero_healing # => 526
|
|
208
220
|
draft.order # Integer, 1-20
|
209
221
|
draft.pick? # Boolean, true if the draft is a pick, and not a ban
|
210
222
|
draft.team # Symbol, :radiant or :dire
|
211
|
-
draft.hero # Dota::API::Hero
|
223
|
+
draft.hero # Dota::API::Hero, Picked or banned hero
|
212
224
|
```
|
213
225
|
|
214
226
|
#### Cosmetic Rarities
|
@@ -223,9 +235,9 @@ rarity.color # String, The hexadecimal RGB tuple
|
|
223
235
|
#### Friends
|
224
236
|
|
225
237
|
```ruby
|
226
|
-
friend.id #
|
227
|
-
friend.relationship # String, Relation to the
|
228
|
-
friend.made_at # Time, When the friend was added to the list
|
238
|
+
friend.id # Integer, Friend's 64-bit Steam ID
|
239
|
+
friend.relationship # String, Relation to the player
|
240
|
+
friend.made_at # Time, When the friend was added to the player's friend list
|
229
241
|
```
|
230
242
|
|
231
243
|
## Contributing
|
data/lib/dota/api/friend.rb
CHANGED
data/lib/dota/api/match.rb
CHANGED
@@ -141,6 +141,46 @@ module Dota
|
|
141
141
|
def dire_barracks_status
|
142
142
|
raw["barracks_status_dire"]
|
143
143
|
end
|
144
|
+
|
145
|
+
def radiant_id
|
146
|
+
raw["radiant_team_id"]
|
147
|
+
end
|
148
|
+
|
149
|
+
def radiant_name
|
150
|
+
raw["radiant_name"]
|
151
|
+
end
|
152
|
+
|
153
|
+
def radiant_logo_id
|
154
|
+
raw["radiant_logo"]
|
155
|
+
end
|
156
|
+
|
157
|
+
def radiant_complete?
|
158
|
+
raw["radiant_team_complete"] == 1
|
159
|
+
end
|
160
|
+
|
161
|
+
def radiant_captain_id
|
162
|
+
raw["radiant_captain"]
|
163
|
+
end
|
164
|
+
|
165
|
+
def dire_id
|
166
|
+
raw["dire_team_id"]
|
167
|
+
end
|
168
|
+
|
169
|
+
def dire_name
|
170
|
+
raw["dire_name"]
|
171
|
+
end
|
172
|
+
|
173
|
+
def dire_logo_id
|
174
|
+
raw["dire_logo"]
|
175
|
+
end
|
176
|
+
|
177
|
+
def dire_complete?
|
178
|
+
raw["dire_team_complete"] == 1
|
179
|
+
end
|
180
|
+
|
181
|
+
def dire_captain_id
|
182
|
+
raw["dire_captain"]
|
183
|
+
end
|
144
184
|
end
|
145
185
|
end
|
146
186
|
end
|
data/lib/dota/version.rb
CHANGED
data/spec/dota/api/match_spec.rb
CHANGED
@@ -96,4 +96,44 @@ describe Dota::API::Match do
|
|
96
96
|
specify "#dire_barracks_status" do
|
97
97
|
expect(match.dire_barracks_status).to eq 63
|
98
98
|
end
|
99
|
+
|
100
|
+
specify "#radiant_id" do
|
101
|
+
expect(match.radiant_id).to eq 1375614
|
102
|
+
end
|
103
|
+
|
104
|
+
specify "#radiant_name" do
|
105
|
+
expect(match.radiant_name).to eq "Newbee"
|
106
|
+
end
|
107
|
+
|
108
|
+
specify "#radiant_logo_id" do
|
109
|
+
expect(match.radiant_logo_id).to eq 794064971723724234
|
110
|
+
end
|
111
|
+
|
112
|
+
specify "#radiant_complete?" do
|
113
|
+
expect(match.radiant_complete?).to eq true
|
114
|
+
end
|
115
|
+
|
116
|
+
specify "#radiant_captain_id" do
|
117
|
+
expect(match.radiant_captain_id).to eq 98887913
|
118
|
+
end
|
119
|
+
|
120
|
+
specify "#dire_id" do
|
121
|
+
expect(match.dire_id).to eq 726228
|
122
|
+
end
|
123
|
+
|
124
|
+
specify "#dire_name" do
|
125
|
+
expect(match.dire_name).to eq "Vici Gaming"
|
126
|
+
end
|
127
|
+
|
128
|
+
specify "#dire_logo_id" do
|
129
|
+
expect(match.dire_logo_id).to eq 34096951715893495
|
130
|
+
end
|
131
|
+
|
132
|
+
specify "#dire_complete?" do
|
133
|
+
expect(match.dire_complete?).to eq true
|
134
|
+
end
|
135
|
+
|
136
|
+
specify "#dire_captain_id" do
|
137
|
+
expect(match.dire_captain_id).to eq 91698091
|
138
|
+
end
|
99
139
|
end
|