megasena 0.0.9 → 1.0.0
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 +8 -8
- data/config/contests.yml +4 -4
- data/lib/lottery/duplasena.rb +3 -0
- data/lib/lottery/gamble.rb +11 -1
- data/lib/lottery/megasena.rb +3 -0
- data/lib/lottery/quina.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGIzMmQwMGI3ZTRmMTkyYmY1MWY4NzI1NmUxOTg5MjJlMzQxYzBmMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Mzg3MDdiNmQzZGE0MzhhZWE2OTk4NjE0N2FiOGI0NTRlYWRhYmY4Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTg5NTczYTlmODUxOGIwNGI2YTMwOWZhZTdiNjNlYzU0NDAxMDczNmI0YjQz
|
10
|
+
ZTM2MzBiZTJlZDliNmM0OWZhNWFmMjhmNWI2MjQ1NDEzNjViNWZkMzAyMjdh
|
11
|
+
MjE1MzFmZWFmNzI4MDA3OWFkZjA3YmZhY2Q5ZjJhNzAxMzRhNTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWE3ZDE2YWY5NWY3NGYyNzEyYjk4NDQ5ZDJkZWQ5YTMxNGVjZmMxYzBlZmQx
|
14
|
+
NGUwODNkZGU0ODE5MDVjNDhjOTRmNTRhZDAzOTEzMDE4NzVlYjlkZTk1M2Yx
|
15
|
+
N2E0MmEzMDBmYTBjNzllY2EwMGVkMTE0Y2Q4MmNkM2UzNTA5Mjg=
|
data/config/contests.yml
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
megasena:
|
2
2
|
url: "http://www1.caixa.gov.br/loterias/loterias/megasena/megasena_pesquisa_new.asp"
|
3
|
-
dom: "//
|
3
|
+
dom: "//span[@class='num_sorteio'][position()=1]/ul/li"
|
4
4
|
quina:
|
5
5
|
url: "http://www1.caixa.gov.br/loterias/loterias/quina/quina_pesquisa_new.asp"
|
6
6
|
dom: "//span[@id='sorteio2']/ul/li"
|
7
|
-
|
8
|
-
|
9
|
-
|
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"
|
10
10
|
# instantanea:
|
11
11
|
# url: ""
|
12
12
|
# dom: ""
|
data/lib/lottery/duplasena.rb
CHANGED
data/lib/lottery/gamble.rb
CHANGED
@@ -3,6 +3,7 @@ require 'mechanize'
|
|
3
3
|
|
4
4
|
module Lottery
|
5
5
|
class Gamble
|
6
|
+
private
|
6
7
|
attr_accessor :contest, :numbers
|
7
8
|
|
8
9
|
def path
|
@@ -14,7 +15,16 @@ module Lottery
|
|
14
15
|
def initialize
|
15
16
|
page = Mechanize.new.get( path[:url] ).parser
|
16
17
|
@contest = page.at("//p").inner_html.scan(/(?=^)\d+/).first.to_i
|
17
|
-
@numbers = page.xpath( path[:dom] )
|
18
|
+
@numbers = page.xpath( path[:dom] )
|
19
|
+
end
|
20
|
+
|
21
|
+
public
|
22
|
+
def get_contest
|
23
|
+
@contest
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_numbers
|
27
|
+
@numbers
|
18
28
|
end
|
19
29
|
|
20
30
|
end
|
data/lib/lottery/megasena.rb
CHANGED
data/lib/lottery/quina.rb
CHANGED