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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14f510faa908119241ad508e4c126d3c5847733b
4
- data.tar.gz: 8c2dd0a8973f5fe66492f8adb165adf0e792816d
3
+ metadata.gz: 162651799f46be59b58c43fcf6bbca4b0c1e7f4b
4
+ data.tar.gz: 204150c428657ef9f6b4075bcdec2a03a35b3064
5
5
  SHA512:
6
- metadata.gz: 03ba07c884cfaa5e80d83dff3b87c930778e40ec198b8d529a6858ea7726df40c9f7931ab7411f60e3e52f047ea36fe3745cb03a99b569f95433d3611b24e8bb
7
- data.tar.gz: c816b9726a656320a155a4f6e3bf8de96c0d3d6bbb200334170b179ac7e34567cf66ad2db84ddd87c99e3e794cd074bb66bf7692ea1f38b88892ce652f4c5956
6
+ metadata.gz: ab2f4222e2983380edf2675d5b39f2e63b00de7400b2c346abe19f7ba195fa75e364aefbefa1652ae0ae541092563cf25994cd2f35d39a8be2b1029bc9bcb2e6
7
+ data.tar.gz: 6de3adb69ec2a38eb97a2510a679de5aa6821ef2e96dea4a90e2dda752a1539941e7e78ed07398f3bd21330321f6c6f844db08014db457c76e898a67f6bed2bf
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Interwetten
2
2
 
3
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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
@@ -1,3 +1,5 @@
1
+ require 'nokogiri'
2
+ require 'active_support/core_ext/object/to_query'
1
3
  require "interwetten/version"
2
4
  require "interwetten/common_methods"
3
5
  require "interwetten/clients"
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Interwetten
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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.1
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: 2013-12-21 00:00:00.000000000 Z
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