quakelive_api 0.0.1

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.
Files changed (57) hide show
  1. data/.gitignore +21 -0
  2. data/.travis.yml +9 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +76 -0
  6. data/Rakefile +14 -0
  7. data/lib/quakelive_api/base.rb +52 -0
  8. data/lib/quakelive_api/error/player_not_found.rb +6 -0
  9. data/lib/quakelive_api/error/request_error.rb +6 -0
  10. data/lib/quakelive_api/game_time.rb +34 -0
  11. data/lib/quakelive_api/items/award.rb +7 -0
  12. data/lib/quakelive_api/items/competitor.rb +7 -0
  13. data/lib/quakelive_api/items/favourite.rb +7 -0
  14. data/lib/quakelive_api/items/model.rb +7 -0
  15. data/lib/quakelive_api/items/recent_game.rb +7 -0
  16. data/lib/quakelive_api/items/record.rb +7 -0
  17. data/lib/quakelive_api/items/structurable.rb +13 -0
  18. data/lib/quakelive_api/items/weapon.rb +7 -0
  19. data/lib/quakelive_api/parser/awards.rb +50 -0
  20. data/lib/quakelive_api/parser/base.rb +33 -0
  21. data/lib/quakelive_api/parser/statistics.rb +81 -0
  22. data/lib/quakelive_api/parser/summary.rb +174 -0
  23. data/lib/quakelive_api/profile/awards/base.rb +24 -0
  24. data/lib/quakelive_api/profile/awards/career_milestones.rb +14 -0
  25. data/lib/quakelive_api/profile/awards/experience.rb +14 -0
  26. data/lib/quakelive_api/profile/awards/mad_skillz.rb +14 -0
  27. data/lib/quakelive_api/profile/awards/social_life.rb +15 -0
  28. data/lib/quakelive_api/profile/awards/sweet_success.rb +14 -0
  29. data/lib/quakelive_api/profile/statistics.rb +18 -0
  30. data/lib/quakelive_api/profile/summary.rb +35 -0
  31. data/lib/quakelive_api/profile.rb +43 -0
  32. data/lib/quakelive_api/version.rb +3 -0
  33. data/lib/quakelive_api.rb +38 -0
  34. data/quakelive_api.gemspec +28 -0
  35. data/test/fixtures/awards/career.txt +382 -0
  36. data/test/fixtures/awards/experience.txt +769 -0
  37. data/test/fixtures/awards/mad_skillz.txt +915 -0
  38. data/test/fixtures/awards/social_life.txt +155 -0
  39. data/test/fixtures/awards/sweet_success.txt +684 -0
  40. data/test/fixtures/profile/error.txt +24 -0
  41. data/test/fixtures/profile/not_found.txt +36 -0
  42. data/test/fixtures/profile/summary.txt +383 -0
  43. data/test/fixtures/statistics/emqz.txt +431 -0
  44. data/test/fixtures/statistics/xsi.txt +558 -0
  45. data/test/fixtures/summary/emqz.txt +304 -0
  46. data/test/fixtures/summary/mariano.txt +380 -0
  47. data/test/quakelive_api/game_time_test.rb +51 -0
  48. data/test/quakelive_api/profile/awards/career_milestones_test.rb +38 -0
  49. data/test/quakelive_api/profile/awards/experience_test.rb +38 -0
  50. data/test/quakelive_api/profile/awards/mad_skillz_test.rb +38 -0
  51. data/test/quakelive_api/profile/awards/social_life_test.rb +38 -0
  52. data/test/quakelive_api/profile/awards/sweet_success_test.rb +38 -0
  53. data/test/quakelive_api/profile/statistics_test.rb +75 -0
  54. data/test/quakelive_api/profile/summary_test.rb +97 -0
  55. data/test/quakelive_api/profile_test.rb +67 -0
  56. data/test/test_helper.rb +47 -0
  57. metadata +220 -0
@@ -0,0 +1,304 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/0.7.67
3
+ Date: Wed, 31 Jul 2013 07:04:34 GMT
4
+ Content-Type: text/html
5
+ Transfer-Encoding: chunked
6
+ Connection: close
7
+ X-Powered-By: PHP/5.3.3
8
+ X-QL-IDENT: 0 standard
9
+
10
+ <div id='qlv_profile_shared_container' style="text-align: left">
11
+ <div style="display: none" id="prf_player_name">emqz</div>
12
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_player_0_v2013071600.0.png" style="margin-top: 10px; margin-bottom: 8px" width="214" height="29" />
13
+ <div class="prf_header">
14
+ <div class="playername player_nick_light"><img src="http://cdn.quakelive.com/web/2013071600/images/flags/pl_v2013071600.0.gif" class="playerflag" title="Poland" />emqz</div>
15
+
16
+ <div class="nav">
17
+ <a href="#!profile/summary/emqz" class="selected">Summary</a>
18
+ <span>|</span>
19
+ <a href="#!profile/statistics/emqz" >Statistics</a>
20
+ <span>|</span>
21
+ <a href="#!profile/arenas/emqz" >Arenas</a>
22
+ <span>|</span>
23
+ <a href="#!profile/awards/emqz" >Awards</a>
24
+ <span>|</span>
25
+ <a href="#!profile/friends/emqz" >Friends</a>
26
+ <span>|</span>
27
+ <a href="#!profile/competitors/emqz" >Competitors</a>
28
+ <span>|</span>
29
+ <a href="#!profile/matches/emqz" >Matches</a>
30
+ <div class="cl"></div>
31
+ </div>
32
+
33
+ <form onsubmit="quakelive.mod_profile.ProfileJumpClick(); return false" style="margin: 0; padding: 0">
34
+ <div id="jump_player_msg"></div>
35
+ <div class="prf_section_searchbar">
36
+ <input type="text" value="Jump to profile&hellip;" onfocus="quakelive.mod_profile.FocusProfileJump(this)" onblur="quakelive.mod_profile.BlurProfileJump(this)" class="input_default" id="profile_jump_input" />
37
+ <a href="javascript:;" onclick="quakelive.mod_profile.ProfileJumpClick(); return false"><img src="http://cdn.quakelive.com/web/2013071600/images/sf/leaderboard/search_v2013071600.0.png" width="23" height="23" /></a>
38
+ </div>
39
+ </form>
40
+
41
+ <div class="cl"></div>
42
+ </div>
43
+
44
+ <div id="qlv_profileContainer">
45
+ <div id="qlv_profileTopLeft" class="summary premium_status_0">
46
+ <div class="prf_imagery">
47
+ <div style="width: 160px; height: 275px; background: url(http://cdn.quakelive.com/web/2013071600/images/players/body_md/major_default_v2013071600.0.png) no-repeat center top" title="Major / Default"></div>
48
+ <br />
49
+ <!--
50
+ <div style="margin-left: 15px; width: 140px; text-align: center; color: #cc3300; font-size: 17px; font-weight: bold; font-family: Arial">
51
+ Major
52
+ </div>
53
+ -->
54
+ </div>
55
+
56
+ <div class="prf_vitals">
57
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_vitalstats_v2013071600.0.png" alt="Vital Stats" width="108" height="13" class="prf_title" />
58
+ <br />
59
+
60
+ <p>
61
+ <b>Member Since:</b> Jun. 23, 2013<br />
62
+
63
+ <b>Last Game:</b>
64
+ Never played online <br />
65
+ <b>Wins:</b> 0<br />
66
+ <b>Losses / Quits:</b> 0 / 0<br />
67
+ <b>Frags / Deaths:</b> 0 / 0<br />
68
+ <b>Hits / Shots:</b> 0 / 0<br />
69
+ <b>Accuracy:</b> 0.00%<br />
70
+
71
+ </p>
72
+
73
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_favorites_v2013071600.0.png" width="93" height="13" alt="Favorites" class="prf_title" />
74
+ <br />
75
+
76
+ <p class="prf_faves">
77
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/none_v2013071600.0.gif" width="17" height="17" alt="" class="fl fivepxhr" />
78
+ <b>Arena:</b> None
79
+ <div class="cl"></div>
80
+ </p>
81
+
82
+ <p class="fivepxv prf_faves">
83
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/none_v2013071600.0.gif" width="17" height="17" alt="" class="fl fivepxhr" />
84
+ <b>Game Type:</b> None
85
+
86
+ <div class="cl"></div>
87
+ </p>
88
+
89
+ <p class="fivepxv prf_faves">
90
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/none_v2013071600.0.gif" width="17" height="17" alt="" class="fl fivepxhr" />
91
+ <b>Weapon:</b> None
92
+ <div class="cl"></div>
93
+ </p>
94
+ </div>
95
+
96
+ <div class="cl"></div>
97
+
98
+ <div id="prf_friend_like">
99
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.quakelive.com/r/profile/summary/emqz" data-text="Check out emqz's QUAKE LIVE Profile!" data-count="none" data-via="quakelive">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
100
+ <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.quakelive.com%2Fr%2Fprofile%2Fsummary%2Femqz&amp;layout=button_count&amp;show_faces=false&amp;width=140&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:140px; height:21px;" allowTransparency="true"></iframe>
101
+ </div>
102
+ <div id="prf_friend_controls">
103
+ </div>
104
+ </div>
105
+
106
+ <div id="qlv_profileTopRight" class="summary">
107
+ <div id="qlv_summaryAwardBkd">
108
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_recentawards_v2013071600.0.png" alt="Recent Medals" width="147" height="13" class="prf_title" />
109
+ <br />
110
+
111
+ <!--<img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_viewmore_v2013071600.0.png" width="80" height="8" class="prf_viewmore" />-->
112
+
113
+ <div class="prf_awards">
114
+ <div class="awd_details vcenter_outer prf_row1">
115
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/medal_placeholder_v2013071600.0.png" width="61" height="61" class="prf_award" />
116
+ <div class="vcenter_outer prf_row_height">
117
+ <div class="vcenter_inner">
118
+ <div class="vcenter_data">
119
+ <b class="awd_grey">No recent award</b>
120
+ <div class="cl"></div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ <div class="awd_details vcenter_outer prf_row2">
126
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/medal_placeholder_v2013071600.0.png" width="61" height="61" class="prf_award" />
127
+ <div class="vcenter_outer prf_row_height">
128
+ <div class="vcenter_inner">
129
+ <div class="vcenter_data">
130
+ <b class="awd_grey">No recent award</b>
131
+ <div class="cl"></div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ <div class="awd_details vcenter_outer prf_row1">
137
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/medal_placeholder_v2013071600.0.png" width="61" height="61" class="prf_award" />
138
+ <div class="vcenter_outer prf_row_height">
139
+ <div class="vcenter_inner">
140
+ <div class="vcenter_data">
141
+ <b class="awd_grey">No recent award</b>
142
+ <div class="cl"></div>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ <div class="awd_details vcenter_outer prf_row2">
148
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/medal_placeholder_v2013071600.0.png" width="61" height="61" class="prf_award" />
149
+ <div class="vcenter_outer prf_row_height">
150
+ <div class="vcenter_inner">
151
+ <div class="vcenter_data">
152
+ <b class="awd_grey">No recent award</b>
153
+ <div class="cl"></div>
154
+ </div>
155
+ </div>
156
+ </div>
157
+ </div>
158
+ <div class="awd_details vcenter_outer prf_row1">
159
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/medal_placeholder_v2013071600.0.png" width="61" height="61" class="prf_award" />
160
+ <div class="vcenter_outer prf_row_height">
161
+ <div class="vcenter_inner">
162
+ <div class="vcenter_data">
163
+ <b class="awd_grey">No recent award</b>
164
+ <div class="cl"></div>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ </div>
169
+ </div>
170
+ </div>
171
+ </div>
172
+
173
+ <div class="cl"></div>
174
+
175
+ <div id="qlv_profileMiddle" class="summary">
176
+ <div id="qlv_profileMiddleContent">
177
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_recentmatches_v2013071600.0.png" class="prf_title" style="float: left" />
178
+ <!--<img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_viewmore_v2013071600.0.png" alt="Recent Matches" width="80" height="8" style="float: right; margin-top: 4px" />-->
179
+ <br />
180
+ <hr class="cl" style="height: 1px" />
181
+
182
+ <div style="text-align: center; width: 637px">
183
+ <div style="width: 33%; text-align: center; float: left" class="prf_map"><img style="margin-top: 50px" src="http://cdn.quakelive.com/web/2013071600/images/profile/map/title_nomatch_v2013071600.0.png" width="97" height="26" /></div>
184
+ <div style="width: 33%; text-align: center; float: left" class="prf_map"><img style="margin-top: 50px" src="http://cdn.quakelive.com/web/2013071600/images/profile/map/title_nomatch_v2013071600.0.png" width="97" height="26" /></div>
185
+ <div style="width: 33%; text-align: center; float: left" class="prf_map"><img style="margin-top: 50px" src="http://cdn.quakelive.com/web/2013071600/images/profile/map/title_nomatch_v2013071600.0.png" width="97" height="26" /></div>
186
+ <div class="cl"></div>
187
+ </div>
188
+ </div>
189
+ </div>
190
+ </div>
191
+
192
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/profile_bot_divider_v2013071600.0.gif" width="670" height="17" />
193
+
194
+ <div id="qlv_profileBottom" class="qlv_profile_section_summary">
195
+ <div id="qlv_profileBottomContent">
196
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_recentcompetitors_v2013071600.0.png" class="prf_title fl" style="position: relative; left: 2px" />
197
+ <!--<img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_viewmore_v2013071600.0.png" alt="Recent Competitors" style="float: right; margin-top: 4px; margin-right: 15px" />-->
198
+ <br />
199
+
200
+ <div id="qlv_profileBottomInset" style="text-align: center">
201
+ <div style="margin: 0 auto; width: 640px; padding-top: 10px">
202
+ <div class="rcmp_block">
203
+ <div class="icon_holder">
204
+ </div>
205
+ <div class="rcmp_none">
206
+ <br />
207
+ No recent competitor
208
+ </div>
209
+ </div>
210
+ <div class="rcmp_block">
211
+ <div class="icon_holder">
212
+ </div>
213
+ <div class="rcmp_none">
214
+ <br />
215
+ No recent competitor
216
+ </div>
217
+ </div>
218
+ <div class="rcmp_block">
219
+ <div class="icon_holder">
220
+ </div>
221
+ <div class="rcmp_none">
222
+ <br />
223
+ No recent competitor
224
+ </div>
225
+ </div>
226
+ <div class="rcmp_block">
227
+ <div class="icon_holder">
228
+ </div>
229
+ <div class="rcmp_none">
230
+ <br />
231
+ No recent competitor
232
+ </div>
233
+ </div>
234
+ <div class="rcmp_block">
235
+ <div class="icon_holder">
236
+ </div>
237
+ <div class="rcmp_none">
238
+ <br />
239
+ No recent competitor
240
+ </div>
241
+ </div>
242
+ <div class="rcmp_block">
243
+ <div class="icon_holder">
244
+ </div>
245
+ <div class="rcmp_none">
246
+ <br />
247
+ No recent competitor
248
+ </div>
249
+ </div>
250
+ <div class="rcmp_block">
251
+ <div class="icon_holder">
252
+ </div>
253
+ <div class="rcmp_none">
254
+ <br />
255
+ No recent competitor
256
+ </div>
257
+ </div>
258
+ <div class="rcmp_block">
259
+ <div class="icon_holder">
260
+ </div>
261
+ <div class="rcmp_none">
262
+ <br />
263
+ No recent competitor
264
+ </div>
265
+ </div>
266
+ <div class="rcmp_block">
267
+ <div class="icon_holder">
268
+ </div>
269
+ <div class="rcmp_none">
270
+ <br />
271
+ No recent competitor
272
+ </div>
273
+ </div>
274
+ <div class="rcmp_block">
275
+ <div class="icon_holder">
276
+ </div>
277
+ <div class="rcmp_none">
278
+ <br />
279
+ No recent competitor
280
+ </div>
281
+ </div>
282
+ <div class="rcmp_block">
283
+ <div class="icon_holder">
284
+ </div>
285
+ <div class="rcmp_none">
286
+ <br />
287
+ No recent competitor
288
+ </div>
289
+ </div>
290
+ <div class="rcmp_block">
291
+ <div class="icon_holder">
292
+ </div>
293
+ <div class="rcmp_none">
294
+ <br />
295
+ No recent competitor
296
+ </div>
297
+ </div>
298
+ <div class="cl"></div>
299
+ </div>
300
+ </div>
301
+ </div>
302
+ </div>
303
+
304
+ </div>