slaghund_scraper 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fabb25a8d2bd346345c17e9bd2746b2fb1faa2f0
4
+ data.tar.gz: 9c3c01a8eb2f7ca6a3c5cd0e5cb7598ca8907b87
5
+ SHA512:
6
+ metadata.gz: 5664e6a5361ea4daddd5c8a91d24f82dc2d44aba5356b0e3374122b8b25dd9af9a9c20b65d5980125e0401a1cdebc24dd7b9e8601537a8389b7b6452efe1dba9
7
+ data.tar.gz: 46f5ebbe842670e252e0ce2052da996cfc158a66825ab6330efaa33a2cbcc7eaafd21375334147a8748d915d46d66edf5a018af907da40ca17d9771a60e5edf0
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ slaghund_scraper
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in slaghund_scraper.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,9 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :rspec do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+ end
9
+
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Matt Wilson
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # SlaghundScraper
2
+
3
+ [Slaghund](http://84.205.248.92/slaghund/slagview.aspx) is a nifty little utility that tracks
4
+ [Android: Netrunner](http://www.fantasyflightgames.com/edge_minisite.asp?eidm=207&enmi=Android:%20Netrunner%20The%20Card%20Game) [OCTGN](http://octgn.gamersjudgement.com/wordpress/anr/) result data. This here is a scraper that will give you CSV.
5
+
6
+ You can check out the ANR OCTGN plugin on [github](https://github.com/db0/Android-Netrunner-OCTGN)!
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'slaghund_scraper'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install slaghund_scraper
21
+
22
+ ## Usage / API
23
+
24
+ The scraper is really pretty simple. To get results as an array:
25
+
26
+ ```ruby
27
+ data = SlaghundScraper.new.scrape!
28
+ ```
29
+
30
+ Or you can go straight-to-csv:
31
+
32
+ ```ruby
33
+ csv = SlaghundScraper.new.to_csv
34
+ ```
35
+
36
+ Here's what the CSV looks like:
37
+
38
+ ```csv
39
+ Jinteki,15063,17653,46.04,3.0,13.0,15,35
40
+ Personal Evolution,11217,11854,48.62,2.9,12.5,14,34
41
+ Replicating Perfection,3846,5799,39.88,3.3,14.3,16,36
42
+ Haas-Bioroid,22010,23345,48.53,4.8,13.4,15,34
43
+ Engineering the Future,18031,16812,51.75,5.0,13.3,15,34
44
+ Stronger Together,966,1998,32.59,3.5,12.2,16,36
45
+ Engineered for Success,577,983,36.99,3.4,21.7,16,33
46
+ Guarding the Net,1553,2527,38.06,4.4,10.7,14,32
47
+ Infinite Frontiers,883,1025,46.28,4.4,14.8,15,29
48
+ Weyland Consortium,16700,15913,51.21,3.5,13.7,14,32
49
+ Building a Better World,14627,12356,54.21,3.6,13.6,14,32
50
+ Because We Built It,2073,3557,36.82,3.1,14.3,15,34
51
+ NBN,19840,19475,50.46,4.3,13.5,15,32
52
+ Making News,15783,15860,49.88,4.2,13.9,15,34
53
+ The World Is Yours,4057,3615,52.88,4.4,11.7,13,25
54
+ Anarch,21428,21373,50.06,5.2,13.6,14,32
55
+ Noise,15251,14663,50.98,5.3,13.2,14,32
56
+ Whizzard,6144,6678,47.92,5.0,14.5,15,31
57
+ Reina Roja,33,32,50.77,5.2,14.6,14,29
58
+ Shaper,27398,31349,46.64,5.1,12.6,15,34
59
+ Kate McCaffrey,13916,15617,47.12,5.0,13.0,15,36
60
+ Chaos Theory,7922,9543,45.36,5.0,14.3,15,31
61
+ Exile,1119,1333,45.64,5.0,14.5,15,33
62
+ Rielle Kit Peddler,3490,3674,48.72,5.4,9.5,15,31
63
+ The Professor,766,1072,41.68,4.8,1.0,15,31
64
+ The Collective,185,110,62.71,5.5,4.9,14,31
65
+ Criminal,27560,20891,56.88,5.6,13.8,15,34
66
+ Gabriel Santiago,16173,13115,55.22,5.5,13.2,15,36
67
+ Andromeda,11258,7619,59.64,5.7,14.6,15,31
68
+ Laramy Fisk,129,157,45.10,5.0,14.4,13,26
69
+ ```
70
+
71
+ The columns are:
72
+
73
+ `Name, Wins, Losses, Win Percentage, Average Agenda Points, Average Influence, Average Turns, Average Game Length`
74
+
75
+ ## Contributing
76
+
77
+ 1. Fork it
78
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
79
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
80
+ 4. Push to the branch (`git push origin my-new-feature`)
81
+ 5. Create new Pull Request
82
+
83
+ ## License
84
+
85
+ SlaghundScraper is provided under an MIT license. Have fun and enjoy. Best. Game. Evar.
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec) do |spec|
6
+ spec.pattern = 'spec/**/*_spec.rb'
7
+ spec.rspec_opts = ['--backtrace']
8
+ # spec.ruby_opts = ['-w']
9
+ end
10
+
11
+ task :default => :spec
@@ -0,0 +1,45 @@
1
+ require "slaghund_scraper/version"
2
+ require "excon"
3
+ require 'nokogiri'
4
+
5
+ class SlaghundScraper
6
+ attr_accessor :response, :csv
7
+
8
+ SLAGHUND = 'http://84.205.248.92/slaghund/slagview.aspx'
9
+
10
+ def fetch_data
11
+ self.response = Excon.get(SLAGHUND)
12
+ end
13
+
14
+ def nokogirize response = self.response
15
+ if response.status == 200
16
+ Nokogiri::HTML(response.body)
17
+ else
18
+ raise StandardError.new("Response was: #{response.status}")
19
+ end
20
+ end
21
+
22
+ def reduce doc
23
+ doc.css('td > table:not([id]) tr').map { |row| clean_line row.text }
24
+ end
25
+
26
+ def clean_line line
27
+ line
28
+ .strip
29
+ .gsub(/\s{2,}/, ' ')
30
+ .gsub(/-->\s?/, '')
31
+ .gsub(',', '.')
32
+ .gsub(/(\(|\)|\/|%|")/, '')
33
+ .squeeze(' ')
34
+ .split(/\s(?=\d)/).join(",")
35
+ end
36
+
37
+ def scrape!
38
+ reduce nokogirize fetch_data
39
+ end
40
+
41
+ def to_csv
42
+ self.csv = scrape!.join("\r\n")
43
+ end
44
+
45
+ end
@@ -0,0 +1,3 @@
1
+ class SlaghundScraper
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/slaghund_scraper/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Matt Wilson"]
6
+ gem.email = ["mhw@hypomodern.com"]
7
+ gem.description = %q{Slaghund OCTGN stats scraper}
8
+ gem.summary = %q{Slaghund OCTGN stats scraper}
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "slaghund_scraper"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = SlaghundScraper::VERSION
17
+
18
+ gem.add_development_dependency 'rspec'
19
+ gem.add_development_dependency 'vcr'
20
+ gem.add_development_dependency 'guard-rspec'
21
+ gem.add_dependency 'excon'
22
+ gem.add_dependency 'nokogiri'
23
+ gem.add_dependency 'rake'
24
+ end
@@ -0,0 +1,589 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://84.205.248.92/slaghund/slagview.aspx
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - excon/0.25.3
12
+ response:
13
+ status:
14
+ code: 200
15
+ message:
16
+ headers:
17
+ Cache-Control:
18
+ - private
19
+ Content-Type:
20
+ - text/html; charset=utf-8
21
+ Server:
22
+ - Microsoft-IIS/7.5
23
+ Set-Cookie:
24
+ - ASP.NET_SessionId=13jmyvbbf0sbfrsfyudtyuna; path=/; HttpOnly
25
+ X-AspNet-Version:
26
+ - 4.0.30319
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Date:
30
+ - Sat, 28 Dec 2013 17:40:51 GMT
31
+ Content-Length:
32
+ - '50494'
33
+ body:
34
+ encoding: UTF-8
35
+ string: "\r\n\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
36
+ \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\"
37
+ xml:lang=\"en\">\r\n<head><link rel=\"stylesheet\" type=\"text/css\" href=\"/Slaghund/DXR.axd?r=1_7-TV937\"
38
+ /><link rel=\"stylesheet\" type=\"text/css\" href=\"/Slaghund/DXR.axd?r=1_8-TV937\"
39
+ /><link rel=\"stylesheet\" type=\"text/css\" href=\"/Slaghund/DXR.axd?r=1_1-TV937\"
40
+ /><title>\r\n\r\n</title><link href=\"Styles/Site.css\" rel=\"stylesheet\"
41
+ type=\"text/css\" /><link rel=\"stylesheet\" href=\"blueprint/screen.css\"
42
+ type=\"text/css\" media=\"screen, projection\" /><link rel=\"stylesheet\"
43
+ href=\"blueprint/print.css\" type=\"text/css\" media=\"print\" /><link rel=\"stylesheet\"
44
+ href=\"blueprint/plugins/silksprite/sprite.css\" type=\"text/css\" media=\"print\"
45
+ /> \r\n <!--[if lt IE 8]>\r\n <link rel=\"stylesheet\" href=\"blueprint/ie.css\"
46
+ type=\"text/css\" media=\"screen, projection\" />\r\n <![endif]-->\r\n
47
+ \ <script type=\"text/javascript\">\r\n\r\n var _gaq = _gaq || [];\r\n
48
+ \ _gaq.push(['_setAccount', 'UA-36792075-1']);\r\n _gaq.push(['_trackPageview']);\r\n\r\n
49
+ \ (function () {\r\n var ga = document.createElement('script');
50
+ ga.type = 'text/javascript'; ga.async = true;\r\n ga.src = ('https:'
51
+ == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r\n
52
+ \ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga,
53
+ s);\r\n })();\r\n\r\n</script>\r\n \r\n <title></title>\r\n <script
54
+ type=\"text/javascript\">\r\n // <![CDATA[\r\n var postponedCallbackRequired
55
+ = false;\r\n function OnItemClick(value) {\r\n if (CallbackPanel.InCallback())\r\n
56
+ \ postponedCallbackRequired = true;\r\n else\r\n
57
+ \ CallbackPanel.PerformCallback(value);\r\n }\r\n function
58
+ OnEndCallback(s, e) {\r\n if (postponedCallbackRequired) {\r\n
59
+ \ CallbackPanel.PerformCallback();\r\n postponedCallbackRequired
60
+ = false;\r\n }\r\n }\r\n // ]]> \r\n </script>\r\n
61
+ \ \r\n <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\"></script>\r\n
62
+ \ <script type=\"text/javascript\" src=\"Scripts/highcharts.js\"></script>\r\n</head>\r\n<body>\r\n
63
+ \ <form method=\"post\" action=\"slagview.aspx\" id=\"ctl01\">\r\n<input
64
+ type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"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\"
65
+ />\r\n\r\n<script type=\"text/javascript\">\r\n$(function () {\r\n var
66
+ chart;\r\n $(document).ready(function () {\r\n chart = new Highcharts.Chart({\r\n
67
+ \ chart: {\r\n renderTo: 'chart',\r\n type:
68
+ 'column'\r\n },\r\n title: {\r\n text:
69
+ 'Game Breakdown by Month'\r\n },\r\n xAxis: {\r\n categories:
70
+ ['2012-9','2012-10','2012-11','2012-12','2013-1','2013-2','2013-3','2013-4','2013-5','2013-6','2013-7','2013-8','2013-9','2013-10','2013-11','2013-12',]\r\n
71
+ \ },\r\n yAxis: {\r\n min: 0,\r\n title:
72
+ {\r\n text: 'Total Games'\r\n },\r\n stackLabels:
73
+ {\r\n enabled: true,\r\n style: {\r\n
74
+ \ fontWeight: 'bold',\r\n color:
75
+ (Highcharts.theme && Highcharts.theme.textColor) || 'gray'\r\n }\r\n
76
+ \ }\r\n },\r\n legend: {\r\n align:
77
+ 'right',\r\n x: -100,\r\n verticalAlign: 'top',\r\n
78
+ \ y: 20,\r\n floating: true,\r\n backgroundColor:
79
+ (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',\r\n
80
+ \ borderColor: '#CCC',\r\n borderWidth: 1,\r\n
81
+ \ shadow: false\r\n },\r\n tooltip: {\r\n
82
+ \ formatter: function () {\r\n return '<b>'
83
+ + this.x + '</b><br/>' +\r\n this.series.name + ':
84
+ ' + this.y + ' (' + this.point.percentage.toFixed(2) + '%)<br/>' +\r\n 'Total:
85
+ ' + this.point.stackTotal;\r\n }\r\n },\r\n plotOptions:
86
+ {\r\n column: {\r\n stacking: 'normal',\r\n
87
+ \ dataLabels: {\r\n enabled: true,\r\n
88
+ \ color: (Highcharts.theme && Highcharts.theme.dataLabelsColor)
89
+ || 'white'\r\n }\r\n }\r\n },\r\n
90
+ \ series: [{name:'Corp Wins', data: [334,1257,1101,1133,2638,4154,5062,6008,6606,6878,6173,8243,6597,7950,6351,3128,]},{name:'Runner
91
+ Wins', data: [437,1278,1204,1186,2825,4262,5042,6399,7069,6648,6109,9117,6897,8093,6685,3135,]}]\r\n
92
+ \ });\r\n });\r\n\r\n});</script>\r\n<input type=\"hidden\" name=\"__EVENTVALIDATION\"
93
+ id=\"__EVENTVALIDATION\" value=\"/wEWAgKryun3AQKqi5szSYAua8OmzFKr6X6JW5IsZ7z4wVzPLqRAuZd+yNUb4AA=\"
94
+ />\r\n <div class=\"page\">\r\n <div class=\"header\">\r\n <div
95
+ class=\"legend\">\r\n <h1>\r\n Slaghund\r\n
96
+ \ </h1>\r\n </div>\r\n </div>\r\n <div
97
+ class=\"main\">\r\n \r\n \r\n <div class=\"success\">\r\n
98
+ \ Stat tracking for Android:Netrunner matches played over Octagon</div>\r\n
99
+ \ \r\n <div class=\"box \" align=\"center\">\r\n <table
100
+ width=\"100%\" cellspacing=\"1\" valign=\"top\">\r\n <tr>\r\n
101
+ \ <td><span id=\"MainContent_lbTotalMatches\"><div class='notice'>Total
102
+ Matches Tracked: <b>149999</b> - Total Unique Players:<b>9139</b></div></span>\r\n
103
+ \ </td>\r\n <td align=\"left\">\r\n
104
+ \ <span id=\"MainContent_lbCorpWins\"><div class='success'>Corporation
105
+ Victories: <b>73613</b></div></span> &nbsp&nbsp\r\n <span
106
+ id=\"MainContent_lbRunnerWins\"><div class='alert'>Runner Victories: <b>76386</b></div></span>\r\n
107
+ \ </td>\r\n </tr>\r\n <tr>\r\n
108
+ \ <td colspan=\"2\" align=\"center\">\r\n <div
109
+ id=\"chart\"></div>\r\n <p class=\"notice\">\r\n <b>Detailed
110
+ Breakdown</b></p>\r\n </td>\r\n </tr>\r\n
111
+ \ <tr>\r\n <td valign=\"top\" style=\"vertical-align:top\">\r\n
112
+ \ \r\n <table>\r\n <thead>\r\n
113
+ \ <td>\r\n <b>Corporation</b>\r\n
114
+ \ </td>\r\n <td
115
+ class=\"label\" align=\"center\">\r\n <div
116
+ align=\"center\"><b>Win/Loss %</b></div>\r\n </td>\r\n
117
+ \ <td class=\"label\" align=\"center\">\r\n
118
+ \ <div align=\"center\"><b>Av. Score</b></div>\r\n
119
+ \ </td>\r\n <td
120
+ class=\"label\" align=\"center\">\r\n <div
121
+ align=\"center\"><b>Av. Influence</b></div>\r\n </td>\r\n
122
+ \ <td class=\"label\" align=\"center\">\r\n
123
+ \ <div align=\"center\"><b>Av. Turns</b></div>\r\n
124
+ \ </td>\r\n <td
125
+ class=\"label\" align=\"center\">\r\n <div
126
+ align=\"center\"><b>Av. Duration</b></div>\r\n </td>\r\n
127
+ \ </thead>\r\n \r\n
128
+ \ <tr>\r\n <td
129
+ align=\"left\">\r\n <a href=\"#\" onclick=\"OnItemClick('Jinteki')\">\r\n
130
+ \ Jinteki</a>\r\n </td>\r\n
131
+ \ <td>\r\n <div
132
+ align=\"center\">15063 / 17653 (46,04%)</div>\r\n </td>\r\n
133
+ \ <td align=\"center\">\r\n <div
134
+ align=\"center\">3,0</div>\r\n </td>\r\n
135
+ \ <td align=\"center\">\r\n <div
136
+ align=\"center\">13,0</div>\r\n </td>\r\n
137
+ \ <td align=\"center\">\r\n <div
138
+ align=\"center\">15</div>\r\n </td>\r\n
139
+ \ <td align=\"center\">\r\n <div
140
+ align=\"center\">35</div>\r\n </td>\r\n
141
+ \ </tr>\r\n \r\n
142
+ \ \r\n \r\n <tr>\r\n
143
+ \ <td align=\"right\">\r\n \r\n
144
+ \ --> Personal Evolution\r\n </td>\r\n
145
+ \ <td>\r\n <div
146
+ align=\"center\">11217 / 11854 (48,62%)</div>\r\n </td>\r\n
147
+ \ <td align=\"center\">\r\n <div
148
+ align=\"center\">2,9</div>\r\n </td>\r\n
149
+ \ <td align=\"center\">\r\n <div
150
+ align=\"center\">12,5</div>\r\n </td>\r\n
151
+ \ <td align=\"center\">\r\n <div
152
+ align=\"center\">14</div>\r\n </td>\r\n
153
+ \ <td align=\"center\">\r\n <div
154
+ align=\"center\">34</div>\r\n </td>\r\n
155
+ \ </tr>\r\n \r\n
156
+ \ <tr>\r\n <td align=\"right\">\r\n
157
+ \ \r\n -->
158
+ \ Replicating Perfection\r\n </td>\r\n
159
+ \ <td>\r\n <div
160
+ align=\"center\">3846 / 5799 (39,88%)</div>\r\n </td>\r\n
161
+ \ <td align=\"center\">\r\n <div
162
+ align=\"center\">3,3</div>\r\n </td>\r\n
163
+ \ <td align=\"center\">\r\n <div
164
+ align=\"center\">14,3</div>\r\n </td>\r\n
165
+ \ <td align=\"center\">\r\n <div
166
+ align=\"center\">16</div>\r\n </td>\r\n
167
+ \ <td align=\"center\">\r\n <div
168
+ align=\"center\">36</div>\r\n </td>\r\n
169
+ \ </tr>\r\n \r\n
170
+ \ \r\n \r\n <tr>\r\n
171
+ \ <td align=\"left\">\r\n <a
172
+ href=\"#\" onclick=\"OnItemClick('Haas-Bioroid')\">\r\n Haas-Bioroid</a>\r\n
173
+ \ </td>\r\n <td>\r\n
174
+ \ <div align=\"center\">22010 / 23345
175
+ (48,53%)</div>\r\n </td>\r\n <td
176
+ align=\"center\">\r\n <div align=\"center\">4,8</div>\r\n
177
+ \ </td>\r\n <td
178
+ align=\"center\">\r\n <div align=\"center\">13,4</div>\r\n
179
+ \ </td>\r\n <td
180
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
181
+ \ </td>\r\n <td
182
+ align=\"center\">\r\n <div align=\"center\">34</div>\r\n
183
+ \ </td>\r\n </tr>\r\n
184
+ \ \r\n \r\n \r\n
185
+ \ <tr>\r\n <td align=\"right\">\r\n
186
+ \ \r\n -->
187
+ \ Engineering the Future\r\n </td>\r\n
188
+ \ <td>\r\n <div
189
+ align=\"center\">18031 / 16812 (51,75%)</div>\r\n </td>\r\n
190
+ \ <td align=\"center\">\r\n <div
191
+ align=\"center\">5,0</div>\r\n </td>\r\n
192
+ \ <td align=\"center\">\r\n <div
193
+ align=\"center\">13,3</div>\r\n </td>\r\n
194
+ \ <td align=\"center\">\r\n <div
195
+ align=\"center\">15</div>\r\n </td>\r\n
196
+ \ <td align=\"center\">\r\n <div
197
+ align=\"center\">34</div>\r\n </td>\r\n
198
+ \ </tr>\r\n \r\n
199
+ \ <tr>\r\n <td align=\"right\">\r\n
200
+ \ \r\n -->
201
+ \ Stronger Together\r\n </td>\r\n <td>\r\n
202
+ \ <div align=\"center\">966 / 1998 (32,59%)</div>\r\n
203
+ \ </td>\r\n <td
204
+ align=\"center\">\r\n <div align=\"center\">3,5</div>\r\n
205
+ \ </td>\r\n <td
206
+ align=\"center\">\r\n <div align=\"center\">12,2</div>\r\n
207
+ \ </td>\r\n <td
208
+ align=\"center\">\r\n <div align=\"center\">16</div>\r\n
209
+ \ </td>\r\n <td
210
+ align=\"center\">\r\n <div align=\"center\">36</div>\r\n
211
+ \ </td>\r\n </tr>\r\n
212
+ \ \r\n <tr>\r\n <td
213
+ align=\"right\">\r\n \r\n -->
214
+ \ Engineered for Success\r\n </td>\r\n
215
+ \ <td>\r\n <div
216
+ align=\"center\">577 / 983 (36,99%)</div>\r\n </td>\r\n
217
+ \ <td align=\"center\">\r\n <div
218
+ align=\"center\">3,4</div>\r\n </td>\r\n
219
+ \ <td align=\"center\">\r\n <div
220
+ align=\"center\">21,7</div>\r\n </td>\r\n
221
+ \ <td align=\"center\">\r\n <div
222
+ align=\"center\">16</div>\r\n </td>\r\n
223
+ \ <td align=\"center\">\r\n <div
224
+ align=\"center\">33</div>\r\n </td>\r\n
225
+ \ </tr>\r\n \r\n
226
+ \ <tr>\r\n <td align=\"right\">\r\n
227
+ \ \r\n -->
228
+ \ Guarding the Net\r\n </td>\r\n <td>\r\n
229
+ \ <div align=\"center\">1553 / 2527
230
+ (38,06%)</div>\r\n </td>\r\n <td
231
+ align=\"center\">\r\n <div align=\"center\">4,4</div>\r\n
232
+ \ </td>\r\n <td
233
+ align=\"center\">\r\n <div align=\"center\">10,7</div>\r\n
234
+ \ </td>\r\n <td
235
+ align=\"center\">\r\n <div align=\"center\">14</div>\r\n
236
+ \ </td>\r\n <td
237
+ align=\"center\">\r\n <div align=\"center\">32</div>\r\n
238
+ \ </td>\r\n </tr>\r\n
239
+ \ \r\n <tr>\r\n <td
240
+ align=\"right\">\r\n \r\n -->
241
+ \ Infinite Frontiers\r\n </td>\r\n <td>\r\n
242
+ \ <div align=\"center\">883 / 1025 (46,28%)</div>\r\n
243
+ \ </td>\r\n <td
244
+ align=\"center\">\r\n <div align=\"center\">4,4</div>\r\n
245
+ \ </td>\r\n <td
246
+ align=\"center\">\r\n <div align=\"center\">14,8</div>\r\n
247
+ \ </td>\r\n <td
248
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
249
+ \ </td>\r\n <td
250
+ align=\"center\">\r\n <div align=\"center\">29</div>\r\n
251
+ \ </td>\r\n </tr>\r\n
252
+ \ \r\n \r\n \r\n
253
+ \ <tr>\r\n <td
254
+ align=\"left\">\r\n <a href=\"#\" onclick=\"OnItemClick('Weyland
255
+ Consortium')\">\r\n Weyland Consortium</a>\r\n
256
+ \ </td>\r\n <td>\r\n
257
+ \ <div align=\"center\">16700 / 15913
258
+ (51,21%)</div>\r\n </td>\r\n <td
259
+ align=\"center\">\r\n <div align=\"center\">3,5</div>\r\n
260
+ \ </td>\r\n <td
261
+ align=\"center\">\r\n <div align=\"center\">13,7</div>\r\n
262
+ \ </td>\r\n <td
263
+ align=\"center\">\r\n <div align=\"center\">14</div>\r\n
264
+ \ </td>\r\n <td
265
+ align=\"center\">\r\n <div align=\"center\">32</div>\r\n
266
+ \ </td>\r\n </tr>\r\n
267
+ \ \r\n \r\n \r\n
268
+ \ <tr>\r\n <td align=\"right\">\r\n
269
+ \ \r\n -->
270
+ \ Building a Better World\r\n </td>\r\n
271
+ \ <td>\r\n <div
272
+ align=\"center\">14627 / 12356 (54,21%)</div>\r\n </td>\r\n
273
+ \ <td align=\"center\">\r\n <div
274
+ align=\"center\">3,6</div>\r\n </td>\r\n
275
+ \ <td align=\"center\">\r\n <div
276
+ align=\"center\">13,6</div>\r\n </td>\r\n
277
+ \ <td align=\"center\">\r\n <div
278
+ align=\"center\">14</div>\r\n </td>\r\n
279
+ \ <td align=\"center\">\r\n <div
280
+ align=\"center\">32</div>\r\n </td>\r\n
281
+ \ </tr>\r\n \r\n
282
+ \ <tr>\r\n <td align=\"right\">\r\n
283
+ \ \r\n -->
284
+ \ Because We Built It\r\n </td>\r\n <td>\r\n
285
+ \ <div align=\"center\">2073 / 3557
286
+ (36,82%)</div>\r\n </td>\r\n <td
287
+ align=\"center\">\r\n <div align=\"center\">3,1</div>\r\n
288
+ \ </td>\r\n <td
289
+ align=\"center\">\r\n <div align=\"center\">14,3</div>\r\n
290
+ \ </td>\r\n <td
291
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
292
+ \ </td>\r\n <td
293
+ align=\"center\">\r\n <div align=\"center\">34</div>\r\n
294
+ \ </td>\r\n </tr>\r\n
295
+ \ \r\n \r\n \r\n
296
+ \ <tr>\r\n <td
297
+ align=\"left\">\r\n <a href=\"#\" onclick=\"OnItemClick('NBN')\">\r\n
298
+ \ NBN</a>\r\n </td>\r\n
299
+ \ <td>\r\n <div
300
+ align=\"center\">19840 / 19475 (50,46%)</div>\r\n </td>\r\n
301
+ \ <td align=\"center\">\r\n <div
302
+ align=\"center\">4,3</div>\r\n </td>\r\n
303
+ \ <td align=\"center\">\r\n <div
304
+ align=\"center\">13,5</div>\r\n </td>\r\n
305
+ \ <td align=\"center\">\r\n <div
306
+ align=\"center\">15</div>\r\n </td>\r\n
307
+ \ <td align=\"center\">\r\n <div
308
+ align=\"center\">32</div>\r\n </td>\r\n
309
+ \ </tr>\r\n \r\n
310
+ \ \r\n \r\n <tr>\r\n
311
+ \ <td align=\"right\">\r\n \r\n
312
+ \ --> Making News\r\n </td>\r\n
313
+ \ <td>\r\n <div
314
+ align=\"center\">15783 / 15860 (49,88%)</div>\r\n </td>\r\n
315
+ \ <td align=\"center\">\r\n <div
316
+ align=\"center\">4,2</div>\r\n </td>\r\n
317
+ \ <td align=\"center\">\r\n <div
318
+ align=\"center\">13,9</div>\r\n </td>\r\n
319
+ \ <td align=\"center\">\r\n <div
320
+ align=\"center\">15</div>\r\n </td>\r\n
321
+ \ <td align=\"center\">\r\n <div
322
+ align=\"center\">34</div>\r\n </td>\r\n
323
+ \ </tr>\r\n \r\n
324
+ \ <tr>\r\n <td align=\"right\">\r\n
325
+ \ \r\n -->
326
+ \ The World Is Yours\r\n </td>\r\n <td>\r\n
327
+ \ <div align=\"center\">4057 / 3615
328
+ (52,88%)</div>\r\n </td>\r\n <td
329
+ align=\"center\">\r\n <div align=\"center\">4,4</div>\r\n
330
+ \ </td>\r\n <td
331
+ align=\"center\">\r\n <div align=\"center\">11,7</div>\r\n
332
+ \ </td>\r\n <td
333
+ align=\"center\">\r\n <div align=\"center\">13</div>\r\n
334
+ \ </td>\r\n <td
335
+ align=\"center\">\r\n <div align=\"center\">25</div>\r\n
336
+ \ </td>\r\n </tr>\r\n
337
+ \ \r\n \r\n \r\n
338
+ \ </table>\r\n </td>\r\n
339
+ \ <td valign=\"top\" style=\"vertical-align:top\">\r\n \r\n
340
+ \ <table>\r\n <thead>\r\n
341
+ \ <td>\r\n <b>Runner</b>\r\n
342
+ \ </td>\r\n <td
343
+ class=\"label\" align=\"center\">\r\n <div
344
+ align=\"center\"><b>Win/Loss %</b></div>\r\n </td>\r\n
345
+ \ <td class=\"label\" align=\"center\">\r\n
346
+ \ <div align=\"center\"><b>Av. Score</b></div>\r\n
347
+ \ </td>\r\n <td
348
+ class=\"label\" align=\"center\">\r\n <div
349
+ align=\"center\"><b>Av. Influence</b></div>\r\n </td>\r\n
350
+ \ <td class=\"label\" align=\"center\">\r\n
351
+ \ <div align=\"center\"><b>Av. Turns</b></div>\r\n
352
+ \ </td>\r\n <td
353
+ class=\"label\" align=\"center\">\r\n <div
354
+ align=\"center\"><b>Av. Duration</b></div>\r\n </td>\r\n
355
+ \ </thead>\r\n \r\n
356
+ \ <tr>\r\n <td>\r\n
357
+ \ <a href=\"#\" onclick=\"OnItemClick('Anarch')\">\r\n
358
+ \ Anarch</a>\r\n </td>\r\n
359
+ \ <td align=\"center\">\r\n <div
360
+ align=\"center\">21428 / 21373 (50,06%)</div>\r\n </td>\r\n
361
+ \ <td align=\"center\">\r\n <div
362
+ align=\"center\">5,2</div>\r\n </td>\r\n
363
+ \ <td align=\"center\">\r\n <div
364
+ align=\"center\">13,6</div>\r\n </td>\r\n
365
+ \ <td align=\"center\">\r\n <div
366
+ align=\"center\">14</div>\r\n </td>\r\n
367
+ \ <td align=\"center\">\r\n <div
368
+ align=\"center\">32</div>\r\n </td>\r\n
369
+ \ </tr>\r\n \r\n
370
+ \ \r\n \r\n <tr>\r\n
371
+ \ <td align=\"right\">\r\n \r\n
372
+ \ --> Noise\r\n </td>\r\n
373
+ \ <td>\r\n <div
374
+ align=\"center\">15251 / 14663 (50,98%)</div>\r\n </td>\r\n
375
+ \ <td align=\"center\">\r\n <div
376
+ align=\"center\">5,3</div>\r\n </td>\r\n
377
+ \ <td align=\"center\">\r\n <div
378
+ align=\"center\">13,2</div>\r\n </td>\r\n
379
+ \ <td align=\"center\">\r\n <div
380
+ align=\"center\">14</div>\r\n </td>\r\n
381
+ \ <td align=\"center\">\r\n <div
382
+ align=\"center\">32</div>\r\n </td>\r\n
383
+ \ </tr>\r\n \r\n
384
+ \ <tr>\r\n <td align=\"right\">\r\n
385
+ \ \r\n -->
386
+ \ Whizzard\r\n </td>\r\n <td>\r\n
387
+ \ <div align=\"center\">6144 / 6678
388
+ (47,92%)</div>\r\n </td>\r\n <td
389
+ align=\"center\">\r\n <div align=\"center\">5,0</div>\r\n
390
+ \ </td>\r\n <td
391
+ align=\"center\">\r\n <div align=\"center\">14,5</div>\r\n
392
+ \ </td>\r\n <td
393
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
394
+ \ </td>\r\n <td
395
+ align=\"center\">\r\n <div align=\"center\">31</div>\r\n
396
+ \ </td>\r\n </tr>\r\n
397
+ \ \r\n <tr>\r\n <td
398
+ align=\"right\">\r\n \r\n -->
399
+ \ Reina Roja\r\n </td>\r\n <td>\r\n
400
+ \ <div align=\"center\">33 / 32 (50,77%)</div>\r\n
401
+ \ </td>\r\n <td
402
+ align=\"center\">\r\n <div align=\"center\">5,2</div>\r\n
403
+ \ </td>\r\n <td
404
+ align=\"center\">\r\n <div align=\"center\">14,6</div>\r\n
405
+ \ </td>\r\n <td
406
+ align=\"center\">\r\n <div align=\"center\">14</div>\r\n
407
+ \ </td>\r\n <td
408
+ align=\"center\">\r\n <div align=\"center\">29</div>\r\n
409
+ \ </td>\r\n </tr>\r\n
410
+ \ \r\n \r\n \r\n
411
+ \ <tr>\r\n <td>\r\n
412
+ \ <a href=\"#\" onclick=\"OnItemClick('Shaper')\">\r\n
413
+ \ Shaper</a>\r\n </td>\r\n
414
+ \ <td align=\"center\">\r\n <div
415
+ align=\"center\">27398 / 31349 (46,64%)</div>\r\n </td>\r\n
416
+ \ <td align=\"center\">\r\n <div
417
+ align=\"center\">5,1</div>\r\n </td>\r\n
418
+ \ <td align=\"center\">\r\n <div
419
+ align=\"center\">12,6</div>\r\n </td>\r\n
420
+ \ <td align=\"center\">\r\n <div
421
+ align=\"center\">15</div>\r\n </td>\r\n
422
+ \ <td align=\"center\">\r\n <div
423
+ align=\"center\">34</div>\r\n </td>\r\n
424
+ \ </tr>\r\n \r\n
425
+ \ \r\n \r\n <tr>\r\n
426
+ \ <td align=\"right\">\r\n \r\n
427
+ \ --> Kate McCaffrey\r\n </td>\r\n
428
+ \ <td>\r\n <div
429
+ align=\"center\">13916 / 15617 (47,12%)</div>\r\n </td>\r\n
430
+ \ <td align=\"center\">\r\n <div
431
+ align=\"center\">5,0</div>\r\n </td>\r\n
432
+ \ <td align=\"center\">\r\n <div
433
+ align=\"center\">13,0</div>\r\n </td>\r\n
434
+ \ <td align=\"center\">\r\n <div
435
+ align=\"center\">15</div>\r\n </td>\r\n
436
+ \ <td align=\"center\">\r\n <div
437
+ align=\"center\">36</div>\r\n </td>\r\n
438
+ \ </tr>\r\n \r\n
439
+ \ <tr>\r\n <td align=\"right\">\r\n
440
+ \ \r\n -->
441
+ \ Chaos Theory\r\n </td>\r\n <td>\r\n
442
+ \ <div align=\"center\">7922 / 9543
443
+ (45,36%)</div>\r\n </td>\r\n <td
444
+ align=\"center\">\r\n <div align=\"center\">5,0</div>\r\n
445
+ \ </td>\r\n <td
446
+ align=\"center\">\r\n <div align=\"center\">14,3</div>\r\n
447
+ \ </td>\r\n <td
448
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
449
+ \ </td>\r\n <td
450
+ align=\"center\">\r\n <div align=\"center\">31</div>\r\n
451
+ \ </td>\r\n </tr>\r\n
452
+ \ \r\n <tr>\r\n <td
453
+ align=\"right\">\r\n \r\n -->
454
+ \ Exile\r\n </td>\r\n <td>\r\n
455
+ \ <div align=\"center\">1119 / 1333
456
+ (45,64%)</div>\r\n </td>\r\n <td
457
+ align=\"center\">\r\n <div align=\"center\">5,0</div>\r\n
458
+ \ </td>\r\n <td
459
+ align=\"center\">\r\n <div align=\"center\">14,5</div>\r\n
460
+ \ </td>\r\n <td
461
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
462
+ \ </td>\r\n <td
463
+ align=\"center\">\r\n <div align=\"center\">33</div>\r\n
464
+ \ </td>\r\n </tr>\r\n
465
+ \ \r\n <tr>\r\n <td
466
+ align=\"right\">\r\n \r\n -->
467
+ \ Rielle \"Kit\" Peddler\r\n </td>\r\n
468
+ \ <td>\r\n <div
469
+ align=\"center\">3490 / 3674 (48,72%)</div>\r\n </td>\r\n
470
+ \ <td align=\"center\">\r\n <div
471
+ align=\"center\">5,4</div>\r\n </td>\r\n
472
+ \ <td align=\"center\">\r\n <div
473
+ align=\"center\">9,5</div>\r\n </td>\r\n
474
+ \ <td align=\"center\">\r\n <div
475
+ align=\"center\">15</div>\r\n </td>\r\n
476
+ \ <td align=\"center\">\r\n <div
477
+ align=\"center\">31</div>\r\n </td>\r\n
478
+ \ </tr>\r\n \r\n
479
+ \ <tr>\r\n <td align=\"right\">\r\n
480
+ \ \r\n -->
481
+ \ The Professor\r\n </td>\r\n <td>\r\n
482
+ \ <div align=\"center\">766 / 1072 (41,68%)</div>\r\n
483
+ \ </td>\r\n <td
484
+ align=\"center\">\r\n <div align=\"center\">4,8</div>\r\n
485
+ \ </td>\r\n <td
486
+ align=\"center\">\r\n <div align=\"center\">1,0</div>\r\n
487
+ \ </td>\r\n <td
488
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
489
+ \ </td>\r\n <td
490
+ align=\"center\">\r\n <div align=\"center\">31</div>\r\n
491
+ \ </td>\r\n </tr>\r\n
492
+ \ \r\n <tr>\r\n <td
493
+ align=\"right\">\r\n \r\n -->
494
+ \ The Collective\r\n </td>\r\n <td>\r\n
495
+ \ <div align=\"center\">185 / 110 (62,71%)</div>\r\n
496
+ \ </td>\r\n <td
497
+ align=\"center\">\r\n <div align=\"center\">5,5</div>\r\n
498
+ \ </td>\r\n <td
499
+ align=\"center\">\r\n <div align=\"center\">4,9</div>\r\n
500
+ \ </td>\r\n <td
501
+ align=\"center\">\r\n <div align=\"center\">14</div>\r\n
502
+ \ </td>\r\n <td
503
+ align=\"center\">\r\n <div align=\"center\">31</div>\r\n
504
+ \ </td>\r\n </tr>\r\n
505
+ \ \r\n \r\n \r\n
506
+ \ <tr>\r\n <td>\r\n
507
+ \ <a href=\"#\" onclick=\"OnItemClick('Criminal')\">\r\n
508
+ \ Criminal</a>\r\n </td>\r\n
509
+ \ <td align=\"center\">\r\n <div
510
+ align=\"center\">27560 / 20891 (56,88%)</div>\r\n </td>\r\n
511
+ \ <td align=\"center\">\r\n <div
512
+ align=\"center\">5,6</div>\r\n </td>\r\n
513
+ \ <td align=\"center\">\r\n <div
514
+ align=\"center\">13,8</div>\r\n </td>\r\n
515
+ \ <td align=\"center\">\r\n <div
516
+ align=\"center\">15</div>\r\n </td>\r\n
517
+ \ <td align=\"center\">\r\n <div
518
+ align=\"center\">34</div>\r\n </td>\r\n
519
+ \ </tr>\r\n \r\n
520
+ \ \r\n \r\n <tr>\r\n
521
+ \ <td align=\"right\">\r\n \r\n
522
+ \ --> Gabriel Santiago\r\n </td>\r\n
523
+ \ <td>\r\n <div
524
+ align=\"center\">16173 / 13115 (55,22%)</div>\r\n </td>\r\n
525
+ \ <td align=\"center\">\r\n <div
526
+ align=\"center\">5,5</div>\r\n </td>\r\n
527
+ \ <td align=\"center\">\r\n <div
528
+ align=\"center\">13,2</div>\r\n </td>\r\n
529
+ \ <td align=\"center\">\r\n <div
530
+ align=\"center\">15</div>\r\n </td>\r\n
531
+ \ <td align=\"center\">\r\n <div
532
+ align=\"center\">36</div>\r\n </td>\r\n
533
+ \ </tr>\r\n \r\n
534
+ \ <tr>\r\n <td align=\"right\">\r\n
535
+ \ \r\n -->
536
+ \ Andromeda\r\n </td>\r\n <td>\r\n
537
+ \ <div align=\"center\">11258 / 7619
538
+ (59,64%)</div>\r\n </td>\r\n <td
539
+ align=\"center\">\r\n <div align=\"center\">5,7</div>\r\n
540
+ \ </td>\r\n <td
541
+ align=\"center\">\r\n <div align=\"center\">14,6</div>\r\n
542
+ \ </td>\r\n <td
543
+ align=\"center\">\r\n <div align=\"center\">15</div>\r\n
544
+ \ </td>\r\n <td
545
+ align=\"center\">\r\n <div align=\"center\">31</div>\r\n
546
+ \ </td>\r\n </tr>\r\n
547
+ \ \r\n <tr>\r\n <td
548
+ align=\"right\">\r\n \r\n -->
549
+ \ Laramy Fisk\r\n </td>\r\n <td>\r\n
550
+ \ <div align=\"center\">129 / 157 (45,10%)</div>\r\n
551
+ \ </td>\r\n <td
552
+ align=\"center\">\r\n <div align=\"center\">5,0</div>\r\n
553
+ \ </td>\r\n <td
554
+ align=\"center\">\r\n <div align=\"center\">14,4</div>\r\n
555
+ \ </td>\r\n <td
556
+ align=\"center\">\r\n <div align=\"center\">13</div>\r\n
557
+ \ </td>\r\n <td
558
+ align=\"center\">\r\n <div align=\"center\">26</div>\r\n
559
+ \ </td>\r\n </tr>\r\n
560
+ \ \r\n \r\n \r\n
561
+ \ </table>\r\n </td>\r\n
562
+ \ </tr>\r\n <tr>\r\n <td colspan=\"2\">\r\n
563
+ \ <hr />\r\n </td>\r\n </tr>\r\n
564
+ \ <tr>\r\n <td colspan=\"2\">\r\n <input
565
+ type=\"hidden\"/><script id=\"dxis_928899410\" src=\"/Slaghund/DXR.axd?r=1_142-TV937\"
566
+ type=\"text/javascript\"></script><script id=\"dxis_829996115\" src=\"/Slaghund/DXR.axd?r=1_80-TV937\"
567
+ type=\"text/javascript\"></script><script id=\"dxis_969842924\" src=\"/Slaghund/DXR.axd?r=1_135-TV937\"
568
+ type=\"text/javascript\"></script><script id=\"dxis_1804379365\" src=\"/Slaghund/DXR.axd?r=1_79-TV937\"
569
+ type=\"text/javascript\"></script><div id=\"MainContent_CallbackPanel\">\r\n\t\r\n
570
+ \ <span id=\"MainContent_CallbackPanel_lbFaction\">Click
571
+ on a faction for detailed results</span>\r\n \r\n
572
+ \ \r\n</div><table id=\"MainContent_CallbackPanel_LP\"
573
+ class=\"dxcpLoadingPanelWithContent\" cellspacing=\"0\" cellpadding=\"0\"
574
+ style=\"left:0px;top:0px;z-index:30000;display:none;\">\r\n\t<tr>\r\n\t\t<td
575
+ class=\"dx\" style=\"padding-right:8px;\"><img src=\"/Slaghund/DXR.axd?r=1_48-TV937\"
576
+ alt=\"\" align=\"middle\" /></td><td class=\"dx\" style=\"padding-left:0px;\"><span
577
+ id=\"MainContent_CallbackPanel_TL\">Loading&hellip;</span></td>\r\n\t</tr>\r\n</table><div
578
+ id=\"MainContent_CallbackPanel_LD\" class=\"dxcpLoadingDiv\" style=\"left:0px;top:0px;z-index:29999;display:none;position:absolute;\">\r\n\r\n</div><script
579
+ id=\"dxss_567921887\" type=\"text/javascript\">\n<!--\n\nvar dxo = new ASPxClientCallbackPanel('MainContent_CallbackPanel');\nwindow['CallbackPanel']
580
+ = dxo;\ndxo.callBack = function(arg) { WebForm_DoCallback('ctl00$MainContent$CallbackPanel',arg,aspxCallback,'MainContent_CallbackPanel',aspxCallbackError,true);
581
+ };\ndxo.uniqueID = 'ctl00$MainContent$CallbackPanel';\ndxo.renderIFrameForPopupElements
582
+ = true;\ndxo.EndCallback.AddHandler(OnEndCallback);\ndxo.hideContentOnCallback=false;\ndxo.InlineInitialize();\n\n//-->\n</script>\r\n
583
+ \ </td>\r\n </tr>\r\n </table>\r\n
584
+ \ </div>\r\n\r\n\r\n\r\n </div>\r\n <div class=\"clear\">\r\n
585
+ \ </div>\r\n </div>\r\n <div class=\"footer\">\r\n \r\n
586
+ \ </div>\r\n </form>\r\n</body>\r\n</html>\r\n"
587
+ http_version:
588
+ recorded_at: Sat, 28 Dec 2013 18:11:46 GMT
589
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,60 @@
1
+ require 'spec_helper'
2
+ require 'csv'
3
+
4
+ describe SlaghundScraper do
5
+ let(:scraper) { SlaghundScraper.new }
6
+
7
+ describe "#scrape!", vcr: { cassette_name: 'slaghund' } do
8
+ it "returns an array of csv-formatted results, one row per ID" do
9
+ results = scraper.scrape!
10
+ results.should be_a_kind_of(Array)
11
+ end
12
+ end
13
+
14
+ describe "#to_csv", vcr: { cassette_name: 'slaghund' } do
15
+ it "returns a csv document" do
16
+ doc = scraper.to_csv
17
+ -> { CSV.parse doc }.should_not raise_error
18
+ end
19
+ end
20
+
21
+ describe "#fetch_data", vcr: { cassette_name: 'slaghund' } do
22
+ it "requests data from SlaghundScraper::SLAGHUND" do
23
+ Excon.should_receive(:get).with(SlaghundScraper::SLAGHUND)
24
+ scraper.fetch_data
25
+ end
26
+
27
+ it "saves the response object to the @response ivar" do
28
+ scraper.fetch_data
29
+ scraper.response.should be_a_kind_of(Excon::Response)
30
+ end
31
+ end
32
+
33
+ describe "#nokogirize", vcr: { cassette_name: 'slaghund' } do
34
+ it "returns a Nokogiri document if the response is successful" do
35
+ scraper.nokogirize( scraper.fetch_data ).should be_a_kind_of(Nokogiri::HTML::Document)
36
+ end
37
+
38
+ it "raises an exception otherwise" do
39
+ -> { scraper.nokogirize(double(status: 501)) }.should raise_error
40
+ end
41
+ end
42
+
43
+ describe "#reduce", vcr: { cassette_name: 'slaghund' } do
44
+ it "returns an array of extracted strings" do
45
+ result = scraper.reduce( scraper.nokogirize( scraper.fetch_data ) )
46
+ result.should be_a_kind_of(Array)
47
+ result.each { |line| line.should be_a_kind_of(String) }
48
+ end
49
+ end
50
+
51
+ describe "#clean_line", vcr: { cassette_name: 'slaghund' } do
52
+ let(:reina) { "\r\n--> Reina Roja\r\n 33 / 32\r\n (50,77%)\r\n 5,2 14,6 14\r\n29" }
53
+ subject { scraper.clean_line(reina) }
54
+
55
+ it "formats the output as csv" do
56
+ expect( subject ).to eq 'Reina Roja,33,32,50.77,5.2,14.6,14,29'
57
+ end
58
+ end
59
+
60
+ end
@@ -0,0 +1,24 @@
1
+ require 'vcr'
2
+ require 'slaghund_scraper'
3
+
4
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
5
+ RSpec.configure do |config|
6
+ config.treat_symbols_as_metadata_keys_with_true_values = true
7
+ config.run_all_when_everything_filtered = true
8
+ config.filter_run :focus
9
+
10
+ # Run specs in random order to surface order dependencies. If you find an
11
+ # order dependency and want to debug it, you can fix the order by providing
12
+ # the seed, which is printed after each run.
13
+ # --seed 1234
14
+ config.order = 'random'
15
+
16
+
17
+ end
18
+
19
+ VCR.configure do |c|
20
+ c.cassette_library_dir = 'spec/cassettes'
21
+ c.hook_into :excon
22
+ c.default_cassette_options = { record: :new_episodes }
23
+ c.configure_rspec_metadata!
24
+ end
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slaghund_scraper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Matt Wilson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: vcr
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard-rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: excon
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: nokogiri
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Slaghund OCTGN stats scraper
98
+ email:
99
+ - mhw@hypomodern.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - .gitignore
105
+ - .rspec
106
+ - .ruby-gemset
107
+ - .ruby-version
108
+ - Gemfile
109
+ - Guardfile
110
+ - LICENSE
111
+ - README.md
112
+ - Rakefile
113
+ - lib/slaghund_scraper.rb
114
+ - lib/slaghund_scraper/version.rb
115
+ - slaghund_scraper.gemspec
116
+ - spec/cassettes/slaghund.yml
117
+ - spec/slaghund_scraper_spec.rb
118
+ - spec/spec_helper.rb
119
+ homepage: ''
120
+ licenses: []
121
+ metadata: {}
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - '>='
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 2.2.0
139
+ signing_key:
140
+ specification_version: 4
141
+ summary: Slaghund OCTGN stats scraper
142
+ test_files:
143
+ - spec/cassettes/slaghund.yml
144
+ - spec/slaghund_scraper_spec.rb
145
+ - spec/spec_helper.rb