megasena 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGIzMmQwMGI3ZTRmMTkyYmY1MWY4NzI1NmUxOTg5MjJlMzQxYzBmMA==
4
+ MzVhZGU0MGZkNDIwMWI1NmMwYjA4MTVhYmY4MzMwMWU2NGNiYWZlMg==
5
5
  data.tar.gz: !binary |-
6
- Mzg3MDdiNmQzZGE0MzhhZWE2OTk4NjE0N2FiOGI0NTRlYWRhYmY4Zg==
6
+ MmIwZmQ2OTMyNzNhOTYzNWIyOTFhNGJjZDVkMTRkNTRhM2I0NzgyMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTg5NTczYTlmODUxOGIwNGI2YTMwOWZhZTdiNjNlYzU0NDAxMDczNmI0YjQz
10
- ZTM2MzBiZTJlZDliNmM0OWZhNWFmMjhmNWI2MjQ1NDEzNjViNWZkMzAyMjdh
11
- MjE1MzFmZWFmNzI4MDA3OWFkZjA3YmZhY2Q5ZjJhNzAxMzRhNTE=
9
+ MGQ0ODBhOWVmM2RkYzljNTlmM2QxZDA1MzRiOTI0Y2FjZTljZTU4Yjc2MDVm
10
+ NjI3MmY5Y2RiMDRjYmEzODU4ZDExYTQ5ODM5ZjlmZjU1NzMxMWVmOGQxNmIy
11
+ N2M4MzZkOTRiY2IzNWNkNmViZjUxOTVhMDkwZmZlNzliMzYyZGY=
12
12
  data.tar.gz: !binary |-
13
- OWE3ZDE2YWY5NWY3NGYyNzEyYjk4NDQ5ZDJkZWQ5YTMxNGVjZmMxYzBlZmQx
14
- NGUwODNkZGU0ODE5MDVjNDhjOTRmNTRhZDAzOTEzMDE4NzVlYjlkZTk1M2Yx
15
- N2E0MmEzMDBmYTBjNzllY2EwMGVkMTE0Y2Q4MmNkM2UzNTA5Mjg=
13
+ ZTgxMzY4MzI4Mjc3MGM4MzU0ZTk2NmIyMjA1OTkzOTgyODlmNGY0OGJjODk0
14
+ MGZiNmRhYjY3ZThjNTBiZmZmNmNjYTI2MGY0MmY0OTZiYjdjZmFkNmI2NGI0
15
+ MmM5MDJiZDEzM2NjMjIxMjY5NzgyZmY0NGYwYmIxMGY2NWRjNGI=
data/config/contests.yml CHANGED
@@ -1,21 +1,29 @@
1
1
  megasena:
2
- url: "http://www1.caixa.gov.br/loterias/loterias/megasena/megasena_pesquisa_new.asp"
3
- dom: "//span[@class='num_sorteio'][position()=1]/ul/li"
2
+ :url: 'http://www1.caixa.gov.br/loterias/loterias/megasena/megasena_pesquisa_new.asp'
3
+ :dom: '//span[@class="num_sorteio"][1]/ul/li'
4
4
  quina:
5
- url: "http://www1.caixa.gov.br/loterias/loterias/quina/quina_pesquisa_new.asp"
6
- dom: "//span[@id='sorteio2']/ul/li"
5
+ :url: 'http://www1.caixa.gov.br/loterias/loterias/quina/quina_pesquisa_new.asp'
6
+ :dom: '//span[@id="sorteio2"]/ul/li'
7
7
  duplasena:
8
- url: "http://www1.caixa.gov.br/loterias/loterias/duplasena/duplasena_pesquisa_new.asp"
9
- dom: "//span[@class='num_sorteio'][position()<=2]/ul"
8
+ :url: 'http://www1.caixa.gov.br/loterias/loterias/duplasena/duplasena_pesquisa_new.asp'
9
+ :dom: '//span[@class="num_sorteio"][position()<=2]/ul'
10
10
  # instantanea:
11
11
  # url: ""
12
12
  # dom: ""
13
13
  # federal:
14
14
  # url: ""
15
15
  # dom: ""
16
- # loteca:
17
- # url: "http://www1.caixa.gov.br/loterias/loterias/loteca/loteca_pesquisa_new.asp"
18
- # dom: ""
16
+ loteca:
17
+ :url: 'http://www1.caixa.gov.br/loterias/loterias/loteca/loteca_pesquisa_new.asp'
18
+ :dom: '//tr[@class="linhas"]'
19
+ :etc:
20
+ :game: 'td/div[@id="jogo"]'
21
+ :date: 'td[@class="separador"][5]'
22
+ :player1: 'td[@class="esquerda"]'
23
+ :score_1: 'td[@class="separador"][2]'
24
+ :player2: 'td[@class="direita"]'
25
+ :score_2: 'td[@class="separador"][4]'
26
+
19
27
  # lotofacil:
20
28
  # url: "http://www1.caixa.gov.br/loterias/loterias/lotofacil/lotofacil_pesquisa_new.asp"
21
29
  # dom: ""
@@ -19,13 +19,8 @@ module Lottery
19
19
  end
20
20
 
21
21
  public
22
- def get_contest
23
- @contest
24
- end
25
-
26
- def get_numbers
27
- @numbers
28
- end
22
+ def get_contest; @contest; end
23
+ def get_numbers; @numbers; end
29
24
 
30
25
  end
31
26
  end
@@ -1,4 +1,22 @@
1
1
  module Lottery
2
2
  class Loteca < Lottery::Gamble
3
+ def get_numbers
4
+
5
+ games = Hash.new
6
+ dom = path[:etc]
7
+
8
+ super.each do |tr|
9
+ games.merge!({
10
+ tr.xpath(dom[:game]).text => {
11
+ :date => tr.xpath(dom[:date]).text,
12
+ :player1 => { :name => tr.xpath(dom[:player1]).text, :score => tr.xpath(dom[:score_1]).text.to_i },
13
+ :player2 => { :name => tr.xpath(dom[:player2]).text, :score => tr.xpath(dom[:score_2]).text.to_i }
14
+ }
15
+ })
16
+ end
17
+
18
+ games
19
+
20
+ end
3
21
  end
4
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megasena
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naner Nunes