transfermarkt 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.byebug_history +12 -0
- data/lib/transfermarkt/player.rb +13 -0
- data/lib/transfermarkt/version.rb +1 -1
- 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: 6991fb7c04c7e725b7b125549a6ea212793694b2
|
4
|
+
data.tar.gz: 302407a1ec65092d00a91f91265d3dabe0ec2323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac65287d0925bf014df8e104c6347f52a0c1f633d40f75dace50cce259e7a273e9b9a2282993616428712b4613a5d3be2ce8638e0874596d6c37aff0ee66129e
|
7
|
+
data.tar.gz: e1e93ed87fd59a06357a30be88bb6090ec9269077a7b6aa6735e6c13cbf928107216d001b5cc9dd251fb3b8cf28d2e978e208484b6b5babf3efe76b3f26170d0
|
data/.byebug_history
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
c
|
2
|
+
profile_html.css(".spielprofil_tooltip")[0]["href"]
|
3
|
+
profile_html.css(".spielprofil_tooltip")[0]
|
4
|
+
profile_html.css(".spielprofil_tooltip")[0]["src"]
|
5
|
+
profile_html.css(".spielprofil_tooltip")[0][src]
|
6
|
+
profile_html.css(".spielprofil_tooltip")[0]
|
7
|
+
profile_html.css(".spielprofil_tooltip")
|
8
|
+
c
|
9
|
+
profile_html.css("title")
|
10
|
+
profile_html.css(".items")
|
11
|
+
profile_html.css(".responsive-table")
|
12
|
+
profile_html.css("td.hauptlink:nth-child(2)")
|
13
|
+
c
|
2
14
|
profile_html.css("table.auflistung").search("tr")[1].text
|
3
15
|
profile_html.css("table.auflistung").search("tr").first.text
|
4
16
|
profile_html.css("table.auflistung").search("tr").first
|
data/lib/transfermarkt/player.rb
CHANGED
@@ -43,6 +43,19 @@ module Transfermarkt
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
def self.search(player_name)
|
47
|
+
req = self.get("/schnellsuche/ergebnis/schnellsuche", query: {query: player_name, x: 0, y:0})
|
48
|
+
if req.code != 200
|
49
|
+
nil
|
50
|
+
else
|
51
|
+
profile_html = Nokogiri::HTML(req.parsed_response)
|
52
|
+
results = {}
|
53
|
+
|
54
|
+
link = profile_html.css(".spielprofil_tooltip")[0]["href"]
|
55
|
+
self.fetch_by_profile_uri(link)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
46
59
|
def self.fetch_by_profile_uri(profile_uri = "")
|
47
60
|
req = self.get("/#{profile_uri}", headers: {"User-Agent" => UserAgents.rand()})
|
48
61
|
if req.code != 200
|