soccer-quiz 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58f9e7aec23eb5f33341e9e87a1de33647da4c2ab372bc38d2cb7d2e9f80a66e
4
- data.tar.gz: 4fe91c8ed3673bfa59895bc1b18e2fe59489a342fe829ebbeb9abc8f2e4ddc9d
3
+ metadata.gz: b65ffa6704f8dfe3f0ee837dddc77407187a33ccf805df45519ffee531013399
4
+ data.tar.gz: 286d245df0903b1d4fc709b195ee38dfada98588c92117ca5f36e8d87d4b32c0
5
5
  SHA512:
6
- metadata.gz: 3f5490144a6172a4e58b96e1e3e7745befb0ae747a68d6744ebf71c5e1950e3e3ab5047b560882f8ec6b6b3f4c62f8e08c8d1bee33d23742cda0fce886a85b97
7
- data.tar.gz: 0aab7a0d118a1fcbd1da3358db069292809ff5df84180f5f005a8c0bf75cf4423cc996a699958606fd29f19e2effcc76659e28e33d2a223f231706c6debd193f
6
+ metadata.gz: def75980f2134e5e7ca0812acab4a7baf85b97180e40d6b8f7db621a30a638ed4d7c6216e19d8f42439657241708ed0dc05319fadbcab6d8ed8b25df334b08d8
7
+ data.tar.gz: 218b97aa875bddd21923d9d7e21643d23094626fd7e4baf272cce3a9bb78e08bf9c4b13f42ca7baa93185cdd3354d57ef5605b39761b221987697d76a66bd1ff
data/lib/quiz/scraper.rb CHANGED
@@ -28,39 +28,42 @@ class Quiz::Scraper
28
28
 
29
29
 
30
30
  def self.world_cup
31
- world_cup_url = "https://www.foxsports.com/soccer/fifa-world-cup/history"
31
+ world_cup_url = "https://en.wikipedia.org/wiki/List_of_FIFA_World_Cup_finals"
32
32
  world_cup = "tbody"
33
-
34
33
  world_cup = self.scraper(world_cup_url,world_cup).map{|l|l.text.split(/\r\n|\s{2,}/).reject{|e|e.empty?}}
34
+ world_cup = world_cup[3]
35
+ 8.times{world_cup.shift}
36
+ 3.times{world_cup.pop}
37
+
35
38
  counter = 0
36
39
  all_countries = []
37
- while counter < world_cup[0].size
38
- all_countries << {:year => world_cup[0][counter], :host => world_cup[0][counter + 4], :winner => world_cup[0][counter + 1], :runner_up => world_cup[0][counter + 2], :thirth_place => world_cup[0][counter + 3]}
40
+ while counter < world_cup.size
41
+ all_countries << {:year => world_cup[counter], :host => world_cup[counter + 5], :winner => world_cup[counter + 1], :runner_up => world_cup[counter + 3]}
39
42
  counter += 8
40
43
  end
41
44
  all_countries
42
45
  end
43
-
44
- def self.champion_league
46
+ def self.champion_league
45
47
  champion_league_url = "https://en.wikipedia.org/wiki/List_of_European_Cup_and_UEFA_Champions_League_finals"
46
48
  champion_league_file = "tbody"
47
49
 
48
50
  champions = self.scraper(champion_league_url,champion_league_file).map{|l|l.text.split("\n").reject{|e|e.empty?}}
51
+
49
52
  champions[0].shift
50
53
  champions.shift
51
54
  champions.shift
52
- 10.times{champions[0].shift}
53
- 21.times{champions[0].pop}
55
+ 8.times{champions[0].shift}
56
+
57
+ 14.times{champions[0].pop}
54
58
  2.times{champions[0].delete_at(152)}
55
- champions
56
59
  counter = 0
57
60
  all_teams = []
58
61
  while counter < champions[0].size
59
- all_teams << {:year => champions[0][counter], :winner => champions[0][counter + 2], :score => champions[0][counter + 3], :runner_up => champions[0][counter + 5], :host => champions[0][counter + 6]}
60
- counter += 8
62
+ all_teams << {:year => champions[0][counter], :winner => champions[0][counter + 2], :score => champions[0][counter + 3], :runner_up => champions[0][counter + 4], :host => champions[0][counter + 6]}
63
+ counter += 8
61
64
  end
62
- all_teams
63
- end
65
+ all_teams
66
+ end
64
67
 
65
68
  end
66
69
 
data/lib/quiz/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Quiz
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soccer-quiz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yarvin Hernandez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-21 00:00:00.000000000 Z
11
+ date: 2024-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.3.22
123
+ rubygems_version: 3.3.7
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: 10 questions quiz about soccer.