betlinks 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/betlinks/version.rb +1 -1
- data/lib/betlinks.rb +25 -23
- metadata +2 -2
data/lib/betlinks/version.rb
CHANGED
data/lib/betlinks.rb
CHANGED
@@ -6,42 +6,44 @@ module Betlinks
|
|
6
6
|
def betlinks_init
|
7
7
|
@records = []
|
8
8
|
@current_record = 0
|
9
|
-
@lang_map['
|
10
|
-
@lang_map['
|
9
|
+
@lang_map['БЛ_ВИЛКА'] = "bl_data"
|
10
|
+
@lang_map['бл_данные'] = '@records'
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def bl_data(path)
|
14
14
|
@current_record = 0 if @current_record == @records.length
|
15
|
-
|
15
|
+
bl_read_data(path) if @current_record == 0
|
16
16
|
result = @records[@current_record]
|
17
17
|
@current_record += 1
|
18
18
|
return result
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def bl_read_data(path)
|
22
22
|
data = File.open(path, "r").read
|
23
23
|
forks = data.split(/^\=.*?\n/)
|
24
24
|
forks.each do |f|
|
25
25
|
next if f.strip.empty?
|
26
26
|
@records << {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
27
|
+
'игра' => f.scan(/\d{2}\:\d{2}\.\ (.*?)\:/).flatten(1)[0],
|
28
|
+
'прибыль' => f.scan(/\:\ (.*?)\%/).flatten(1)[0].gsub(',','.').to_f,
|
29
|
+
'дата' => f.scan(/(\d{1,2}[^.].*?)\ в\ \d{2}\:\d{2}/).flatten(1)[0],
|
30
|
+
'время' => f.scan(/в\ (\d{2}\:\d{2})/).flatten(1)[0],
|
31
|
+
'брокер_1' => {
|
32
|
+
'имя' => f.scan(/^1\.\ (.*?);\ /).flatten(1)[0],
|
33
|
+
'вид_ставки' => f.scan(/^1\..*?ставка\ (.*?)\;/).flatten(1)[0],
|
34
|
+
'коэф' => f.scan(/^1\..*?коэф\.\ (.*?)\(/).flatten(1)[0].gsub(',','.').to_f,
|
35
|
+
'вид_спорта' => f.scan(/^1\..*\((.*?)\/\//).flatten(1)[0],
|
36
|
+
'игра' => f.scan(/^1\..*?\/\/\ (.*?)\)/).flatten(1)[0],
|
37
|
+
'ссылка' => f.scan(/^1\..*\n(http.*?)$/).flatten(1)[0].strip!
|
38
|
+
},
|
39
|
+
'брокер_2' => {
|
40
|
+
'имя' => f.scan(/^2\.\ (.*?);\ /).flatten(1)[0],
|
41
|
+
'вид_ставки' => f.scan(/^2\..*?ставка\ (.*?)\;/).flatten(1)[0],
|
42
|
+
'коэф' => f.scan(/^2\..*?коэф\.\ (.*?)\(/).flatten(1)[0].gsub(',','.').to_f,
|
43
|
+
'вид_спорта' => f.scan(/^2\..*\((.*?)\/\//).flatten(1)[0],
|
44
|
+
'игра' => f.scan(/^2\..*?\/\/\ (.*?)\)/).flatten(1)[0],
|
45
|
+
'ссылка' => f.scan(/^2\..*\n(http.*?)/).flatten(1)[0].strip!
|
46
|
+
}
|
45
47
|
}
|
46
48
|
end
|
47
49
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betlinks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Plugin for bets
|
15
15
|
email:
|