soccerwiki 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soccerwiki/player.rb +6 -1
- data/lib/soccerwiki/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 005bb615a90a26c8b37526d186a89e41889d1714
|
4
|
+
data.tar.gz: 4ff106b3635188a43dc5a13388b29dbf51610a72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20e1d9b3c29ccc23be96bc73cbade4f1c44f0ea0a128115cd24e9fe57ba92f3dd44333d5ad3c03eebb09d6900dd37f4c05bc0380aca1ee9da0147d4db4e4cf0d
|
7
|
+
data.tar.gz: aa277d7bcac9160874202b18f2f1438c0af6a3e59adf97ace10d957393eb9de53a5bc4e450a52dbfd5670256006587d117da6cb98aee17badbca0fe5c2c3a45c
|
data/lib/soccerwiki/player.rb
CHANGED
@@ -41,12 +41,17 @@ module Soccerwiki
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.search(player_name)
|
44
|
+
puts "Searching player #{player_name}"
|
44
45
|
req = self.get("/wiki.php", query: {action: "search", "searchType" => "players", q: player_name})
|
45
46
|
if req.code.to_i != 200
|
47
|
+
puts "RESPONSE #{req.code}"
|
46
48
|
[]
|
47
49
|
else
|
48
50
|
html_doc = Nokogiri::HTML(req.parsed_response)
|
49
|
-
|
51
|
+
puts "Using version #{Soccerwiki::VERSION}"
|
52
|
+
puts "Searched #{player_name}"
|
53
|
+
players_links = html_doc.xpath('//div[@id="searchResultsDiv"]//table/tr/td[2]/a').collect {|a| a["href"] }
|
54
|
+
puts "Found #{players_links.count}"
|
50
55
|
players = players_links.collect do |player_link|
|
51
56
|
player_id = player_link.match(/\=([0-9]*)/)[1]
|
52
57
|
self.find_by_id(player_id)
|
data/lib/soccerwiki/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soccerwiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elad Meidar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|