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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 652ee707a1c68398d1a1c5e7fa225efcb5121e62
4
- data.tar.gz: 2ab4ee752870bff4cd27e6302a2664fe4303e6c6
3
+ metadata.gz: 6991fb7c04c7e725b7b125549a6ea212793694b2
4
+ data.tar.gz: 302407a1ec65092d00a91f91265d3dabe0ec2323
5
5
  SHA512:
6
- metadata.gz: 1a17533a019da46374560802bd3498aa5df94273f560c7c8f705c25f24db8c72d66ae882f2539e41b694cf04babf8f52fc9b514e27e69484b43dda961199a28c
7
- data.tar.gz: e3d9d192737972180d2d9a203566fa18d105636985a96b42401439652d27a0ff1592ad10c8cbf418c49d93cd4d70f3464bbeb0b6335aea6c5f31b63d5dfc7dac
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Transfermarkt
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transfermarkt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elad Meidar