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 +8 -8
- data/config/contests.yml +17 -9
- data/lib/lottery/gamble.rb +2 -7
- data/lib/lottery/loteca.rb +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzVhZGU0MGZkNDIwMWI1NmMwYjA4MTVhYmY4MzMwMWU2NGNiYWZlMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmIwZmQ2OTMyNzNhOTYzNWIyOTFhNGJjZDVkMTRkNTRhM2I0NzgyMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGQ0ODBhOWVmM2RkYzljNTlmM2QxZDA1MzRiOTI0Y2FjZTljZTU4Yjc2MDVm
|
10
|
+
NjI3MmY5Y2RiMDRjYmEzODU4ZDExYTQ5ODM5ZjlmZjU1NzMxMWVmOGQxNmIy
|
11
|
+
N2M4MzZkOTRiY2IzNWNkNmViZjUxOTVhMDkwZmZlNzliMzYyZGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTgxMzY4MzI4Mjc3MGM4MzU0ZTk2NmIyMjA1OTkzOTgyODlmNGY0OGJjODk0
|
14
|
+
MGZiNmRhYjY3ZThjNTBiZmZmNmNjYTI2MGY0MmY0OTZiYjdjZmFkNmI2NGI0
|
15
|
+
MmM5MDJiZDEzM2NjMjIxMjY5NzgyZmY0NGYwYmIxMGY2NWRjNGI=
|
data/config/contests.yml
CHANGED
@@ -1,21 +1,29 @@
|
|
1
1
|
megasena:
|
2
|
-
url:
|
3
|
-
dom:
|
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:
|
6
|
-
dom:
|
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:
|
9
|
-
dom:
|
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
|
-
|
17
|
-
|
18
|
-
|
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: ""
|
data/lib/lottery/gamble.rb
CHANGED
data/lib/lottery/loteca.rb
CHANGED
@@ -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
|