interwetten 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -2
- data/interwetten-0.0.1.gem +0 -0
- data/lib/interwetten.rb +2 -0
- data/lib/interwetten/clients/livescore_client.rb +3 -1
- data/lib/interwetten/version.rb +1 -1
- data/spec/interwetten/clients/livescore_client_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 162651799f46be59b58c43fcf6bbca4b0c1e7f4b
|
4
|
+
data.tar.gz: 204150c428657ef9f6b4075bcdec2a03a35b3064
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2f4222e2983380edf2675d5b39f2e63b00de7400b2c346abe19f7ba195fa75e364aefbefa1652ae0ae541092563cf25994cd2f35d39a8be2b1029bc9bcb2e6
|
7
|
+
data.tar.gz: 6de3adb69ec2a38eb97a2510a679de5aa6821ef2e96dea4a90e2dda752a1539941e7e78ed07398f3bd21330321f6c6f844db08014db457c76e898a67f6bed2bf
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Interwetten
|
2
2
|
|
3
|
-
|
3
|
+
Interwetten is a Ruby wrapper of the Interwetten API. As most betting companies APIs, this one provides data of bet markets (matches, options, odds...). But this one also offers the user the result of the offered matches and even livescores.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,41 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
This gem gives you three different clients.
|
22
|
+
|
23
|
+
The Interwetten gem is divided in three clients. But the three of them have one common method: `get_sports'. It returns a hash with the name of the available sports as key and the id in the Interwetten system as value. The latter is important, as you need the sport id to get any kind of information.
|
24
|
+
|
25
|
+
### Interwetten::MarketsClient
|
26
|
+
|
27
|
+
You initialize a MarketsClient with `Interwetten::MarketsClient.new(sport_id)`.
|
28
|
+
|
29
|
+
This client give you the following methods:
|
30
|
+
|
31
|
+
+ `get_competitions`
|
32
|
+
+ `get_events_for_competition(competition_id)`
|
33
|
+
+ `get_events_for_competition`
|
34
|
+
+ `get_market_types_for_competition(competition_id)`
|
35
|
+
|
36
|
+
### Interwetten::ResultsClient
|
37
|
+
|
38
|
+
You initialize a ResultsClient with `Interwetten::ResultsClient.new(sport_id)`.
|
39
|
+
|
40
|
+
This client give you the following methods:
|
41
|
+
|
42
|
+
+ `get_result(event_id)`
|
43
|
+
|
44
|
+
|
45
|
+
### Interwetten::LivescoreClient
|
46
|
+
|
47
|
+
The livescore feature is only available if you register in Interwetten as an affiliate. Anyway, it's pretty simple, you can do it through [this link](http://affiliates.interwetten.com/).
|
48
|
+
|
49
|
+
You initialize a LivescoreClient with `Interwetten::MarketsClient.new(MY_INTERWETTEN_AFFILIATE_NUMBER)`.
|
50
|
+
|
51
|
+
This client give you the following methods:
|
52
|
+
|
53
|
+
+ `get_events`
|
54
|
+
+ `get_score(event_id)`
|
55
|
+
|
22
56
|
|
23
57
|
## Contributing
|
24
58
|
|
Binary file
|
data/lib/interwetten.rb
CHANGED
@@ -61,10 +61,12 @@ module Interwetten
|
|
61
61
|
|
62
62
|
def common_process(event)
|
63
63
|
gametime = event.get_attribute("GAMETIME").delete("´")
|
64
|
+
sport_id = event.get_attribute("LIVE_KOSID")
|
64
65
|
status = event.get_attribute("STATUS")
|
66
|
+
interwetten_id = event.get_attribute("ID")
|
65
67
|
name = event.get_attribute("NAME").gsub("(LIVE)", "").gsub("(live)", "")
|
66
68
|
name = name.split("-").map { |contender| contender.strip }.join("-")
|
67
|
-
{:gametime => gametime, :status => status, :name => name}
|
69
|
+
{interwetten_id: interwetten_id, :gametime => gametime, :status => status, :name => name, sport_id: sport_id}
|
68
70
|
end
|
69
71
|
|
70
72
|
def process_default(event)
|
data/lib/interwetten/version.rb
CHANGED
@@ -23,7 +23,7 @@ describe Interwetten::LivescoreClient do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it "sends back the correct keys" do
|
26
|
-
@livescore.keys.should == [:gametime, :status, :name, :result]
|
26
|
+
@livescore.keys.should == [:interwetten_id, :gametime, :status, :name, :sport_id, :result]
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interwetten
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cristian Planas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- LICENSE.txt
|
108
108
|
- README.md
|
109
109
|
- Rakefile
|
110
|
+
- interwetten-0.0.1.gem
|
110
111
|
- interwetten.gemspec
|
111
112
|
- lib/interwetten.rb
|
112
113
|
- lib/interwetten/clients.rb
|