quakelive_api 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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,380 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/0.7.67
3
+ Date: Wed, 31 Jul 2013 07:04:08 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">Mariano</div>
12
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_player_2_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" />Mariano</div>
15
+
16
+ <div class="nav">
17
+ <a href="#!profile/summary/Mariano" class="selected">Summary</a>
18
+ <span>|</span>
19
+ <a href="#!profile/statistics/Mariano" >Statistics</a>
20
+ <span>|</span>
21
+ <a href="#!profile/arenas/Mariano" >Arenas</a>
22
+ <span>|</span>
23
+ <a href="#!profile/awards/Mariano" >Awards</a>
24
+ <span>|</span>
25
+ <a href="#!profile/friends/Mariano" >Friends</a>
26
+ <span>|</span>
27
+ <a href="#!profile/competitors/Mariano" >Competitors</a>
28
+ <span>|</span>
29
+ <a href="#!profile/matches/Mariano" >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_2">
46
+ <div class="prf_imagery">
47
+ <div style="width: 160px; height: 275px; background: url(http://cdn.quakelive.com/web/2013071600/images/players/body_md/bitterman_default_v2013071600.0.png) no-repeat center top" title="Bitterman / 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
+ Bitterman
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> Feb. 07, 2009<br />
62
+ <b>Time Played:</b> <span class="text_tooltip" title="Ranked Time: 52.19:25:52 Unranked Time: 02:31:02">1.8 months</span><br />
63
+
64
+ <b>Last Game:</b>
65
+ <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
66
+ <br />
67
+ <b>Wins:</b> 4,278<br />
68
+ <b>Losses / Quits:</b> 3,015 / 518<br />
69
+ <b>Frags / Deaths:</b> 97,102 / 88,381<br />
70
+ <b>Hits / Shots:</b> 1,960,767 / 6,085,608<br />
71
+ <b>Accuracy:</b> 32.22%<br />
72
+
73
+ </p>
74
+
75
+ <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" />
76
+ <br />
77
+
78
+ <p class="prf_faves">
79
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/none_v2013071600.0.gif" width="17" height="17" alt="" class="fl fivepxhr" />
80
+ <b>Arena:</b> Furious Heights
81
+ <div class="cl"></div>
82
+ </p>
83
+
84
+ <p class="fivepxv prf_faves">
85
+ <img src="http://cdn.quakelive.com/web/2013071600/images/gametypes/xsm/duel_v2013071600.0.png" width="16" height="16" alt="" class="fl fivepxhr" />
86
+ <b>Game Type:</b> Duel
87
+
88
+ <div class="cl"></div>
89
+ </p>
90
+
91
+ <p class="fivepxv prf_faves">
92
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/weapons/sm/LIGHTNING_v2013071600.0.gif" width="17" height="17" alt="" class="fl fivepxhr" />
93
+ <b>Weapon:</b> Lightning Gun
94
+ <div class="cl"></div>
95
+ </p>
96
+ </div>
97
+
98
+ <div class="cl"></div>
99
+
100
+ <div class="prf_bio">
101
+ <span class="prf_quote_left">&#147;</span>
102
+ <p>http://quake.net.pl
103
+ Classic stuff: Wheel Mouse Optical 1.1a USB 500Hz + Mouse Accel - SteelSeries QCK - Samsung SyncMaster 957 FS 120Hz CRT</p>
104
+ <span class="prf_quote_right">&#148;</span>
105
+ </div>
106
+ <div id="prf_friend_like">
107
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.quakelive.com/r/profile/summary/mariano" data-text="Check out Mariano's QUAKE LIVE Profile!" data-count="none" data-via="quakelive">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
108
+ <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.quakelive.com%2Fr%2Fprofile%2Fsummary%2Fmariano&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>
109
+ </div>
110
+ <div id="prf_friend_controls">
111
+ </div>
112
+ </div>
113
+
114
+ <div id="qlv_profileTopRight" class="summary">
115
+ <div id="qlv_summaryAwardBkd">
116
+ <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" />
117
+ <br />
118
+
119
+ <!--<img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_viewmore_v2013071600.0.png" width="80" height="8" class="prf_viewmore" />-->
120
+
121
+ <div class="prf_awards">
122
+ <div title="Hope you touched the flag first!" class="awd_details prf_row_height interactive prf_row1" onclick="quakelive.Goto('profile/awards/Mariano;type=2;award=281'); return false">
123
+ <img src="http://cdn.quakelive.com/web/2013071600/images/awards/md/team_killer_v2013071600.0.png" width="61" height="61" class="prf_award" />
124
+ <div class="vcenter_outer prf_row_height">
125
+ <div class="vcenter_inner">
126
+ <div class="vcenter_data">
127
+ <b class="awd_title">Team Killer</b><br />
128
+ Awarded 2 months ago<br />
129
+ Kill all players on the opposing team in a single round in Attack & Defend, minimum size 3.
130
+ <div class="cl"></div>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+ <div title="Bittersweet victory." class="awd_details prf_row_height interactive prf_row2" onclick="quakelive.Goto('profile/awards/Mariano;type=2;award=279'); return false">
136
+ <img src="http://cdn.quakelive.com/web/2013071600/images/awards/md/missed_opportunity_v2013071600.0.png" width="61" height="61" class="prf_award" />
137
+ <div class="vcenter_outer prf_row_height">
138
+ <div class="vcenter_inner">
139
+ <div class="vcenter_data">
140
+ <b class="awd_title">Missed Opportunity</b><br />
141
+ Awarded 2 months ago<br />
142
+ Kill the opposing team in Attack & Defend without touching the flag.
143
+ <div class="cl"></div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <div title="Do you think thats air youre breathing now?" class="awd_details prf_row_height interactive prf_row1" onclick="quakelive.Goto('profile/awards/Mariano;type=1;award=339'); return false">
149
+ <img src="http://cdn.quakelive.com/web/2013071600/images/awards/md/pql_1_v2013071600.0.png" width="61" height="61" class="prf_award" />
150
+ <div class="vcenter_outer prf_row_height">
151
+ <div class="vcenter_inner">
152
+ <div class="vcenter_data">
153
+ <b class="awd_title">Too Fast</b><br />
154
+ Awarded 2 months ago<br />
155
+ Complete 1 online PQL match.
156
+ <div class="cl"></div>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ <div title="Denial: Not just a river in Egypt." class="awd_details prf_row_height interactive prf_row2" onclick="quakelive.Goto('profile/awards/Mariano;type=4;award=285'); return false">
162
+ <img src="http://cdn.quakelive.com/web/2013071600/images/awards/md/territory_defender_v2013071600.0.png" width="61" height="61" class="prf_award" />
163
+ <div class="vcenter_outer prf_row_height">
164
+ <div class="vcenter_inner">
165
+ <div class="vcenter_data">
166
+ <b class="awd_title">Territory Defender</b><br />
167
+ Awarded 2 months ago<br />
168
+ Score at least 10 defends in one Domination match.
169
+ <div class="cl"></div>
170
+ </div>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ <div title="You are officially a QUAKE LIVE VIP." class="awd_details prf_row_height interactive prf_row1" onclick="quakelive.Goto('profile/awards/Mariano;type=1;award=20'); return false">
175
+ <img src="http://cdn.quakelive.com/web/2013071600/images/awards/md/worldclass_v2013071600.0.png" width="61" height="61" class="prf_award" />
176
+ <div class="vcenter_outer prf_row_height">
177
+ <div class="vcenter_inner">
178
+ <div class="vcenter_data">
179
+ <b class="awd_title">World-Class</b><br />
180
+ Awarded 5 months ago<br />
181
+ Accumulate 1000 hours of time played.
182
+ <div class="cl"></div>
183
+ </div>
184
+ </div>
185
+ </div>
186
+ </div>
187
+ </div>
188
+ </div>
189
+ </div>
190
+
191
+ <div class="cl"></div>
192
+
193
+ <div id="qlv_profileMiddle" class="summary">
194
+ <div id="qlv_profileMiddleContent">
195
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/titles/ttl_recentmatches_v2013071600.0.png" class="prf_title" style="float: left" />
196
+ <!--<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" />-->
197
+ <br />
198
+ <hr class="cl" style="height: 1px" />
199
+
200
+ <div style="text-align: center; width: 637px">
201
+ <div style="width: 33%; text-align: center; float: left" class="prf_map recent_match interactive" id="tdm_6488c8e4-ea64-11e2-9160-00259031fd90_1">
202
+ <img src="http://cdn.quakelive.com/web/2013071600/images/levelshots/lg/hiddenfortress_v2013071600.0.jpg" width="171" height="124" class="levelshot" />
203
+ <div class="gameframe">
204
+
205
+ <img class="gametype" src="http://cdn.quakelive.com/web/2013071600/images/gametypes/sm/tdm_v2013071600.0.png" width="28" height="28" title="Game Type" />
206
+ <span class="finish">
207
+ Finish:
208
+ Loss
209
+ </span>
210
+ <span class="played">Played: 20 days ago</span>
211
+ </div>
212
+ </div>
213
+ <div style="width: 33%; text-align: center; float: left" class="prf_map recent_match interactive" id="tdm_43ff4cd2-ea60-11e2-9160-00259031fd90_1">
214
+ <img src="http://cdn.quakelive.com/web/2013071600/images/levelshots/lg/purgatory_v2013071600.0.jpg" width="171" height="124" class="levelshot" />
215
+ <div class="gameframe">
216
+
217
+ <img class="gametype" src="http://cdn.quakelive.com/web/2013071600/images/gametypes/sm/tdm_v2013071600.0.png" width="28" height="28" title="Game Type" />
218
+ <span class="finish">
219
+ Finish:
220
+ Loss
221
+ </span>
222
+ <span class="played">Played: 20 days ago</span>
223
+ </div>
224
+ </div>
225
+ <div style="width: 33%; text-align: center; float: left" class="prf_map recent_match interactive" id="tdm_4bfa181a-ea59-11e2-9160-00259031fd90_1">
226
+ <img src="http://cdn.quakelive.com/web/2013071600/images/levelshots/lg/hiddenfortress_v2013071600.0.jpg" width="171" height="124" class="levelshot" />
227
+ <div class="gameframe">
228
+ <div class="profile_won_icon"></div>
229
+
230
+ <img class="gametype" src="http://cdn.quakelive.com/web/2013071600/images/gametypes/sm/tdm_v2013071600.0.png" width="28" height="28" title="Game Type" />
231
+ <span class="finish">
232
+ Finish:
233
+ Win
234
+ </span>
235
+ <span class="played">Played: 20 days ago</span>
236
+ </div>
237
+ </div>
238
+ <div class="cl"></div>
239
+ </div>
240
+ </div>
241
+ </div>
242
+ </div>
243
+
244
+ <img src="http://cdn.quakelive.com/web/2013071600/images/profile/profile_bot_divider_v2013071600.0.gif" width="670" height="17" />
245
+
246
+ <div id="qlv_profileBottom" class="qlv_profile_section_summary">
247
+ <div id="qlv_profileBottomContent">
248
+ <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" />
249
+ <!--<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" />-->
250
+ <br />
251
+
252
+ <div id="qlv_profileBottomInset" style="text-align: center">
253
+ <div style="margin: 0 auto; width: 640px; padding-top: 10px">
254
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/Jeezy'); return false">
255
+ <div class="fl" style="margin-right: 5px">
256
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/bitterman_red_v2013071600.0.png)"><div class="frame"></div><label></label></div>
257
+ </div>
258
+ <div style="margin-top: 6px">
259
+ <a href="#!profile/summary/Jeezy" class="player_nick_dark">Jeezy</a>
260
+ <br />
261
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
262
+ </div>
263
+ </div>
264
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/akilkenny'); return false">
265
+ <div class="fl" style="margin-right: 5px">
266
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/ranger_default_v2013071600.0.png)"><div class="frame"></div><label></label></div>
267
+ </div>
268
+ <div style="margin-top: 6px">
269
+ <a href="#!profile/summary/akilkenny" class="player_nick_dark"><span class="clan">nvc</span>akilkenny</a>
270
+ <br />
271
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
272
+ </div>
273
+ </div>
274
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/Eteto'); return false">
275
+ <div class="fl" style="margin-right: 5px">
276
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/sarge_default_v2013071600.0.png)"><div class="frame"></div><label></label></div>
277
+ </div>
278
+ <div style="margin-top: 6px">
279
+ <a href="#!profile/summary/Eteto" class="player_nick_dark">Eteto</a>
280
+ <br />
281
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
282
+ </div>
283
+ </div>
284
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/killkiss'); return false">
285
+ <div class="fl" style="margin-right: 5px">
286
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/xaero_red_v2013071600.0.png)"><div class="frame"></div><label></label></div>
287
+ </div>
288
+ <div style="margin-top: 6px">
289
+ <a href="#!profile/summary/killkiss" class="player_nick_dark"><span class="clan">[KO]</span>killkiss</a>
290
+ <br />
291
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
292
+ </div>
293
+ </div>
294
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/crAck_'); return false">
295
+ <div class="fl" style="margin-right: 5px">
296
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/bitterman_red_v2013071600.0.png)"><div class="frame"></div><label></label></div>
297
+ </div>
298
+ <div style="margin-top: 6px">
299
+ <a href="#!profile/summary/crAck_" class="player_nick_dark"><span class="clan">/hyk/</span>crAck_</a>
300
+ <br />
301
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
302
+ </div>
303
+ </div>
304
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/uber9petska'); return false">
305
+ <div class="fl" style="margin-right: 5px">
306
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/xaero_blue_v2013071600.0.png)"><div class="frame"></div><label></label></div>
307
+ </div>
308
+ <div style="margin-top: 6px">
309
+ <a href="#!profile/summary/uber9petska" class="player_nick_dark"><span class="clan">planB</span>uber9petska</a>
310
+ <br />
311
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
312
+ </div>
313
+ </div>
314
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/ParaNoiiA'); return false">
315
+ <div class="fl" style="margin-right: 5px">
316
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/sarge_default_v2013071600.0.png)"><div class="frame"></div><label></label></div>
317
+ </div>
318
+ <div style="margin-top: 6px">
319
+ <a href="#!profile/summary/ParaNoiiA" class="player_nick_dark"><span class="clan">8450</span>ParaNoiiA</a>
320
+ <br />
321
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:59 PM">20 days ago</span>
322
+ </div>
323
+ </div>
324
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/Centinela'); return false">
325
+ <div class="fl" style="margin-right: 5px">
326
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/razor_id_v2013071600.0.png)"><div class="frame"></div><label></label></div>
327
+ </div>
328
+ <div style="margin-top: 6px">
329
+ <a href="#!profile/summary/Centinela" class="player_nick_dark"><span class="clan">2E</span>Centinela</a>
330
+ <br />
331
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:29 PM">20 days ago</span>
332
+ </div>
333
+ </div>
334
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/MaskoPatol'); return false">
335
+ <div class="fl" style="margin-right: 5px">
336
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/uriel_default_v2013071600.0.png)"><div class="frame"></div><label></label></div>
337
+ </div>
338
+ <div style="margin-top: 6px">
339
+ <a href="#!profile/summary/MaskoPatol" class="player_nick_dark"><span class="clan">vNm</span>MaskoPatol</a>
340
+ <br />
341
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 2:29 PM">20 days ago</span>
342
+ </div>
343
+ </div>
344
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/dsdl'); return false">
345
+ <div class="fl" style="margin-right: 5px">
346
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/sarge_default_v2013071600.0.png)"><div class="frame"></div><label></label></div>
347
+ </div>
348
+ <div style="margin-top: 6px">
349
+ <a href="#!profile/summary/dsdl" class="player_nick_dark"><span class="clan">wzj-</span>dsdl</a>
350
+ <br />
351
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 1:40 PM">20 days ago</span>
352
+ </div>
353
+ </div>
354
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/Realf1re'); return false">
355
+ <div class="fl" style="margin-right: 5px">
356
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/razor_default_v2013071600.0.png)"><div class="frame"></div><label></label></div>
357
+ </div>
358
+ <div style="margin-top: 6px">
359
+ <a href="#!profile/summary/Realf1re" class="player_nick_dark"><span class="clan">[FU]</span>Realf1re</a>
360
+ <br />
361
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 1:40 PM">20 days ago</span>
362
+ </div>
363
+ </div>
364
+ <div class="rcmp_block interactive" onclick="quakelive.Goto('profile/summary/dashinaction'); return false">
365
+ <div class="fl" style="margin-right: 5px">
366
+ <div class="usericon_standard_lg " style="background-image: url(http://cdn.quakelive.com/web/2013071600/images/players/icon_lg/bitterman_blue_v2013071600.0.png)"><div class="frame"></div><label></label></div>
367
+ </div>
368
+ <div style="margin-top: 6px">
369
+ <a href="#!profile/summary/dashinaction" class="player_nick_dark"><span class="clan">aCt.</span>dashinaction</a>
370
+ <br />
371
+ <b>Last Played:</b> <span class="text_tooltip" title="07/11/2013 1:40 PM">20 days ago</span>
372
+ </div>
373
+ </div>
374
+ <div class="cl"></div>
375
+ </div>
376
+ </div>
377
+ </div>
378
+ </div>
379
+
380
+ </div>
@@ -0,0 +1,51 @@
1
+ require "test_helper"
2
+
3
+ describe "Game time conversion" do
4
+
5
+ before { @game_time = QuakeliveApi::GameTime.new(string) }
6
+
7
+ describe "parses periods without days" do
8
+ let(:string) { "Ranked Time: 21:50 Unranked Time: 04:54" }
9
+
10
+ describe "ranked time" do
11
+ subject { @game_time.ranked }
12
+
13
+ its(:days) { must_equal 0 }
14
+ its(:hours) { must_equal 0 }
15
+ its(:minutes) { must_equal 21 }
16
+ its(:seconds) { must_equal 50 }
17
+ end
18
+
19
+ describe "unranked time" do
20
+ subject { @game_time.unranked }
21
+
22
+ its(:days) { must_equal 0 }
23
+ its(:hours) { must_equal 0 }
24
+ its(:minutes) { must_equal 4 }
25
+ its(:seconds) { must_equal 54 }
26
+ end
27
+ end
28
+
29
+ describe "parses periods with days" do
30
+ let(:string) { "Ranked Time: 50.06:18:30 Unranked Time: 02:31:02" }
31
+
32
+ describe "ranked time" do
33
+ subject { @game_time.ranked }
34
+
35
+ its(:days) { must_equal 50 }
36
+ its(:hours) { must_equal 6 }
37
+ its(:minutes) { must_equal 18 }
38
+ its(:seconds) { must_equal 30 }
39
+ end
40
+
41
+ describe "unranked time" do
42
+ subject { @game_time.unranked }
43
+
44
+ its(:days) { must_equal 0 }
45
+ its(:hours) { must_equal 2 }
46
+ its(:minutes) { must_equal 31 }
47
+ its(:seconds) { must_equal 02 }
48
+ end
49
+ end
50
+
51
+ end
@@ -0,0 +1,38 @@
1
+ require "test_helper"
2
+
3
+ describe "QuakeliveApi::Profile::Awards::CareerMilestones" do
4
+ make_my_diffs_pretty!
5
+
6
+ before do
7
+ profile = "dummy"
8
+ content = fixture_awards('career')
9
+ stub_request(:get, "#{QuakeliveApi.site}/profile/awards/#{profile}/3").to_return(content)
10
+ @awards = QuakeliveApi::Profile::Awards::CareerMilestones.new(profile)
11
+ end
12
+
13
+ describe "earned" do
14
+ subject { @awards.earned }
15
+
16
+ its(:size){ must_equal 8 }
17
+ it { subject.must_be_instance_of Array }
18
+ it { subject.must_include QuakeliveApi::Items::Award.new(
19
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/guardian_v2013071600.0.png',
20
+ 'All you need now is an ear-piece, black suit and shades.',
21
+ 'Guardian',
22
+ Date.parse('09-07-2009'),
23
+ 'Accumulate 100 Capture the Flag Defend Medals.') }
24
+ end
25
+
26
+ describe "unearned" do
27
+ subject { @awards.unearned }
28
+
29
+ its(:size){ must_equal 10 }
30
+ it { subject.must_be_instance_of Array }
31
+ it { subject.must_include QuakeliveApi::Items::Award.new(
32
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/mvp_v2013071600.0.png',
33
+ nil,
34
+ 'MVP',
35
+ nil,
36
+ 'Accumulate 1000 total Capture the Flag Medals (Caps, Def, and Asst combined).') }
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require "test_helper"
2
+
3
+ describe "QuakeliveApi::Profile::Awards::Experience" do
4
+ make_my_diffs_pretty!
5
+
6
+ before do
7
+ profile = "dummy"
8
+ content = fixture_awards('experience')
9
+ stub_request(:get, "#{QuakeliveApi.site}/profile/awards/#{profile}/1").to_return(content)
10
+ @awards = QuakeliveApi::Profile::Awards::Experience.new(profile)
11
+ end
12
+
13
+ describe "earned" do
14
+ subject { @awards.earned }
15
+
16
+ its(:size){ must_equal 11 }
17
+ it { subject.must_be_instance_of Array }
18
+ it { subject.must_include QuakeliveApi::Items::Award.new(
19
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/space_cadet_v2013071600.0.png',
20
+ 'Unfortunately, we don\'t offer frequent flyer miles.',
21
+ 'Space Cadet',
22
+ Date.parse('18-12-2012'),
23
+ 'Complete 1 online match (of at least 5 min.) in each space arena.') }
24
+ end
25
+
26
+ describe "unearned" do
27
+ subject { @awards.unearned }
28
+
29
+ its(:size){ must_equal 25 }
30
+ it { subject.must_be_instance_of Array }
31
+ it { subject.must_include QuakeliveApi::Items::Award.new(
32
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/champion_v2013071600.0.png',
33
+ nil,
34
+ 'Champion',
35
+ nil,
36
+ 'Complete 10,000 online matches.') }
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require "test_helper"
2
+
3
+ describe "QuakeliveApi::Profile::Awards::MadSkillz" do
4
+ make_my_diffs_pretty!
5
+
6
+ before do
7
+ profile = "dummy"
8
+ content = fixture_awards('mad_skillz')
9
+ stub_request(:get, "#{QuakeliveApi.site}/profile/awards/#{profile}/2").to_return(content)
10
+ @awards = QuakeliveApi::Profile::Awards::MadSkillz.new(profile)
11
+ end
12
+
13
+ describe "earned" do
14
+ subject { @awards.earned }
15
+
16
+ its(:size){ must_equal 21 }
17
+ it { subject.must_be_instance_of Array }
18
+ it { subject.must_include QuakeliveApi::Items::Award.new(
19
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/psychic_v2013071600.0.png',
20
+ 'You\'re either lucky or good.',
21
+ 'Psychic',
22
+ Date.parse('16-07-2009'),
23
+ 'Use a rocket to kill an opponent who is in the air.') }
24
+ end
25
+
26
+ describe "unearned" do
27
+ subject { @awards.unearned }
28
+
29
+ its(:size){ must_equal 22 }
30
+ it { subject.must_be_instance_of Array }
31
+ it { subject.must_include QuakeliveApi::Items::Award.new(
32
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/forcing_the_city_gates_v2013071600.0.png',
33
+ nil,
34
+ 'Forcing the City Gates',
35
+ nil,
36
+ 'Score at least 5 frags in a round in Red Rover.') }
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require "test_helper"
2
+
3
+ describe "QuakeliveApi::Profile::Awards::SocialLife" do
4
+ make_my_diffs_pretty!
5
+
6
+ before do
7
+ profile = "dummy"
8
+ content = fixture_awards('social_life')
9
+ stub_request(:get, "#{QuakeliveApi.site}/profile/awards/#{profile}/5").to_return(content)
10
+ @awards = QuakeliveApi::Profile::Awards::SocialLife.new(profile)
11
+ end
12
+
13
+ describe "earned" do
14
+ subject { @awards.earned }
15
+
16
+ its(:size){ must_equal 5 }
17
+ it { subject.must_be_instance_of Array }
18
+ it { subject.must_include QuakeliveApi::Items::Award.new(
19
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/myquakebook_v2013071600.0.png',
20
+ 'We have an opening in marketing for someone like you.',
21
+ 'MyQuakeBook',
22
+ Date.parse('09-07-2009'),
23
+ 'Invite 25 people who join QUAKE LIVE.') }
24
+ end
25
+
26
+ describe "unearned" do
27
+ subject { @awards.unearned }
28
+
29
+ its(:size){ must_equal 2 }
30
+ it { subject.must_be_instance_of Array }
31
+ it { subject.must_include QuakeliveApi::Items::Award.new(
32
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/qc2009_qc_v2013071600.0.png',
33
+ nil,
34
+ 'QuakeCon 2009',
35
+ nil,
36
+ 'Presented to any player who completes a game of QUAKE LIVE at QuakeCon.') }
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require "test_helper"
2
+
3
+ describe "QuakeliveApi::Profile::Awards::SweetSuccess" do
4
+ make_my_diffs_pretty!
5
+
6
+ before do
7
+ profile = "dummy"
8
+ content = fixture_awards('sweet_success')
9
+ stub_request(:get, "#{QuakeliveApi.site}/profile/awards/#{profile}/4").to_return(content)
10
+ @awards = QuakeliveApi::Profile::Awards::SweetSuccess.new(profile)
11
+ end
12
+
13
+ describe "earned" do
14
+ subject { @awards.earned }
15
+
16
+ its(:size){ must_equal 16 }
17
+ it { subject.must_be_instance_of Array }
18
+ it { subject.must_include QuakeliveApi::Items::Award.new(
19
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/pack_hunter_v2013071600.0.png',
20
+ 'Skill, control, strategy - you\'ve got it all.',
21
+ 'Pack Hunter',
22
+ Date.parse('04-03-2013'),
23
+ 'Win 75 Team Deathmatch matches.') }
24
+ end
25
+
26
+ describe "unearned" do
27
+ subject { @awards.unearned }
28
+
29
+ its(:size){ must_equal 16 }
30
+ it { subject.must_be_instance_of Array }
31
+ it { subject.must_include QuakeliveApi::Items::Award.new(
32
+ 'http://cdn.quakelive.com/web/2013071600/images/awards/md/shut_out_v2013071600.0.png',
33
+ nil,
34
+ 'Shut Out',
35
+ nil,
36
+ 'Win a Clan Arena match (of at least 5 rounds) without losing a round.') }
37
+ end
38
+ end