interwetten 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 14f510faa908119241ad508e4c126d3c5847733b
4
+ data.tar.gz: 8c2dd0a8973f5fe66492f8adb165adf0e792816d
5
+ SHA512:
6
+ metadata.gz: 03ba07c884cfaa5e80d83dff3b87c930778e40ec198b8d529a6858ea7726df40c9f7931ab7411f60e3e52f047ea36fe3745cb03a99b569f95433d3611b24e8bb
7
+ data.tar.gz: c816b9726a656320a155a4f6e3bf8de96c0d3d6bbb200334170b179ac7e34567cf66ad2db84ddd87c99e3e794cd074bb66bf7692ea1f38b88892ce652f4c5956
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ # Ignore .DS_Store
2
+ .DS_Store
3
+
4
+ # Ignore Gemfile.lock
5
+ Gemfile.lock
6
+
7
+ # Ignore .ruby-gemset
8
+ .ruby-gemset
9
+
10
+ # Ignore .ruby-version
11
+ .ruby-version
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in interwetten.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Cristian Planas
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Interwetten
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'interwetten'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install interwetten
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'interwetten/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "interwetten"
8
+ spec.version = Interwetten::VERSION
9
+ spec.authors = ["Cristian Planas"]
10
+ spec.email = ["me@cristianplanas.com"]
11
+ spec.description = %q{A Ruby wrapper for the Interwetten API}
12
+ spec.summary = %q{A Ruby wrapper for the Interwetten API}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'nokogiri'
22
+ spec.add_runtime_dependency 'active_support'
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rspec"
27
+ spec.add_development_dependency 'webmock'
28
+ end
@@ -0,0 +1,94 @@
1
+ module Interwetten
2
+ class LivescoreClient
3
+ def initialize(affiliate, options = {})
4
+ params = {
5
+ "LanguageID" => options[:language] || "EN",
6
+ "Filter" => options[:filter],
7
+ "b" => affiliate
8
+ }
9
+ url = "https://ad.interwetten.com/ticker_temp/offer.asmx/GetLiveEventList?" + params.to_query
10
+
11
+ begin
12
+ @xml = Nokogiri::XML(open(URI.escape(url))).remove_namespaces!
13
+ rescue
14
+ end
15
+ end
16
+
17
+ def pluck_events(attribute)
18
+ @xml.search("EVENT").map { |value| value.get_attribute(attribute).to_i } if @xml
19
+ end
20
+
21
+ def get_events_id
22
+ @events_id ||= pluck_events('ID')
23
+ end
24
+
25
+ def get_events_clone_id
26
+ @events_clone_id ||= pluck_events('CLONEID')
27
+ end
28
+
29
+ def get_events
30
+ get_events_clone_id
31
+ end
32
+
33
+ def get_score_by_clone_id(event_id)
34
+ event = @xml.search("EVENT[CLONEID='#{event_id}']").first
35
+ process_score(event)
36
+ end
37
+
38
+ def get_score(event_id)
39
+ get_score_by_clone_id(event_id)
40
+ end
41
+
42
+ def get_last_entry_by_clone_id(event_id)
43
+ event = @xml.search("EVENT[CLONEID='#{event_id}']").first
44
+ entry = event.search("ENTRY").first
45
+ { :id => entry.get_attribute("ID"), :display_time => entry.get_attribute("DISPLAYTIME"),
46
+ :message => entry.get_attribute("MESSAGE") }
47
+ end
48
+
49
+ def process_score(event)
50
+ case event.get_attribute("LIVE_KOSID")
51
+ when "10", "15"
52
+ process_default(event)
53
+ when "11"
54
+ process_tennis(event)
55
+ end
56
+ end
57
+
58
+ def transform_format(value)
59
+ value.split('=').last.delete(' ').gsub(':', '-')
60
+ end
61
+
62
+ def common_process(event)
63
+ gametime = event.get_attribute("GAMETIME").delete("´")
64
+ status = event.get_attribute("STATUS")
65
+ name = event.get_attribute("NAME").gsub("(LIVE)", "").gsub("(live)", "")
66
+ name = name.split("-").map { |contender| contender.strip }.join("-")
67
+ {:gametime => gametime, :status => status, :name => name}
68
+ end
69
+
70
+ def process_default(event)
71
+ result = transform_format(event.get_attribute("SCORE").split("|").first)
72
+ common_process(event).merge(:result => result)
73
+ end
74
+
75
+ def process_tennis(event)
76
+ score = event.get_attribute("SCORE")
77
+ splitted_score = score.split "|"
78
+
79
+ sets = splitted_score.select { |value| value=~/^Set / }.map do |set|
80
+ transform_format(set)
81
+ end
82
+
83
+ in_game = get_value_in_score(splitted_score, "InGame")
84
+ tie_break = get_value_in_score(splitted_score, "Tiebreak")
85
+ serving = get_value_in_score(splitted_score, "#Serving")
86
+
87
+ common_process(event).merge(:sets => sets, :in_game => in_game, :serving => serving, :tie_break => tie_break)
88
+ end
89
+
90
+ def get_value_in_score(score, attribute)
91
+ transform_format(score.detect { |value| value =~/^#{attribute}/ })
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,53 @@
1
+ module Interwetten
2
+ class MarketsClient
3
+ include Interwetten::CommonMethods
4
+
5
+ def feed_params
6
+ "BettingOffers"
7
+ end
8
+
9
+ def get_competitions
10
+ @competitions ||= @xml.search("LEAGUE").map { |value| value.get_attribute("NAME") }
11
+ end
12
+
13
+ def get_competitions_with_id
14
+ @competitions_with_id ||= @xml.search("LEAGUE").map { |value| { :name => value.get_attribute("NAME"), :id => value.get_attribute("ID") } }
15
+ end
16
+
17
+ def get_events_for_competition(competition_id)
18
+ @xml.search("LEAGUE[ID='#{competition_id}']").search("EVENT").map { |value| { :name => value.get_attribute("NAME"),
19
+ :time => value.get_attribute("START_TIME") + " +2", :id => value.get_attribute("EVENTID") } }
20
+ end
21
+
22
+ def get_markets_for_competition(competition_id, type)
23
+ xml_events = @xml.search("LEAGUE[ID='#{competition_id}']").search("EVENT")
24
+ xml_events.map do |xml_event|
25
+ xml_event.search("BET[TYPENAME='#{type}']").map { |value| { :id => value.get_attribute("ID"), :player1 => value.get_attribute("PLAYER1"),
26
+ :player2 => value.get_attribute("PLAYER2"), :tip => value.get_attribute("TIP"), :odds => value.get_attribute("QUOTE") } }
27
+ end
28
+ end
29
+
30
+ def get_market_for_event(event_id, type)
31
+ @xml.search("EVENT[EVENTID='#{event_id}']").search("BET[TYPENAME='#{type}']").map { |value| { :id => value.get_attribute("ID"),
32
+ :player1 => value.get_attribute("PLAYER1"), :player2 => value.get_attribute("PLAYER2"), :tip => value.get_attribute("TIP"),
33
+ :odds => value.get_attribute("QUOTE") } }
34
+ end
35
+
36
+ def get_market_types_for_competition(competition_id)
37
+ @xml.search("LEAGUE[ID='#{competition_id}']").search("BET").map { |value| value.get_attribute "TYPENAME" }.uniq
38
+ end
39
+
40
+ def get_market_types_for_event(event_id)
41
+ @xml.search("EVENT[EVENTID='#{event_id}']").search("BET").map { |value| value.get_attribute "TYPENAME" }.uniq
42
+ end
43
+
44
+ def get_option(option_id)
45
+ option = @xml.search("BET[ID='#{option_id}']").first
46
+ { :odds => option.get_attribute("QUOTE"), :player1 => option.get_attribute("PLAYER1"), :player2 => option.get_attribute("PLAYER2"), :tip => option.get_attribute("TIP") } if option
47
+ end
48
+
49
+ def get_odds_for_option(option_id)
50
+ @xml.search("BET[ID='#{option_id}']").first.get_attribute("QUOTE")
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,18 @@
1
+ module Interwetten
2
+ class ResultsClient
3
+ include Interwetten::CommonMethods
4
+
5
+ def feed_params
6
+ "EventResults"
7
+ end
8
+
9
+ def url
10
+ "http://ad.interwetten.com/XMLFeeder/feeder.asmx/getfeed?"
11
+ end
12
+
13
+ def get_result(event_id)
14
+ xml_node = @xml.search("EVENT[ID='#{event_id}']").first
15
+ xml_node.get_attribute "RESULT" if xml_node
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ require 'interwetten/clients/livescore_client'
2
+ require 'interwetten/clients/markets_client'
3
+ require 'interwetten/clients/results_client'
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+ require 'open-uri'
3
+
4
+ module Interwetten
5
+ module CommonMethods
6
+ attr_reader :sport_id, :language, :xml
7
+
8
+ def initialize(sport_id, options = {})
9
+ @sport_id = sport_id.is_a?(Array) ? sport_id.join(",") : sport_id
10
+ process_options(options)
11
+ url = generate_url
12
+
13
+ begin
14
+ @xml = Nokogiri::XML(open(URI.escape(url))).remove_namespaces!
15
+ rescue
16
+ end
17
+ end
18
+
19
+ def self.get_sports(language = "EN")
20
+ params = {
21
+ "FEEDPARAMS" => "ValidKindofsports",
22
+ "LANGUAGE" => language
23
+ }
24
+ sports_url = "http://ad.interwetten.com/XMLFeeder/feeder.asmx/getfeed?#{params.to_query.gsub("&", "|")}"
25
+ begin
26
+ sports_xml = Nokogiri::XML(open(URI.escape(sports_url))).remove_namespaces!
27
+ sports_xml.search("KINDOFSPORT").inject({}) do |res, value|
28
+ res.merge( { value.get_attribute("NAME") => value.get_attribute("ID") } )
29
+ end
30
+ rescue
31
+ end
32
+ end
33
+
34
+ private
35
+
36
+ def generate_url
37
+ params = {
38
+ "FEEDPARAMS" => feed_params,
39
+ "LANGUAGE" => @language,
40
+ "KINDOFSPORTIDS" => @sport_id
41
+ }
42
+
43
+ CGI.unescape("http://ad.interwetten.com/XMLFeeder/feeder.asmx/getfeed?" + params.to_query.gsub("&", "|"))
44
+ end
45
+
46
+ def process_options(options)
47
+ @language = options[:language] || "EN"
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,3 @@
1
+ module Interwetten
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,3 @@
1
+ require "interwetten/version"
2
+ require "interwetten/common_methods"
3
+ require "interwetten/clients"
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe Interwetten::LivescoreClient do
4
+ before do
5
+ stub_request(:any, /.*/).to_return(:body => mock_output("livescore.xml"))
6
+ @livescore_client = Interwetten::LivescoreClient.new(666)
7
+ end
8
+
9
+ describe :methods do
10
+ describe :get_events do
11
+ before do
12
+ @events = @livescore_client.get_events
13
+ end
14
+
15
+ it "should return an array with the events" do
16
+ @events.should == [9759527, 9759529, 9759228]
17
+ end
18
+ end
19
+
20
+ describe :get_score do
21
+ before do
22
+ @livescore = @livescore_client.get_score(9759527)
23
+ end
24
+
25
+ it "sends back the correct keys" do
26
+ @livescore.keys.should == [:gametime, :status, :name, :result]
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,76 @@
1
+ require 'spec_helper'
2
+
3
+ describe Interwetten::MarketsClient do
4
+ before do
5
+ stub_request(:any, /.*/).to_return(:body => mock_output("events.xml"))
6
+ @results_client = Interwetten::MarketsClient.new(666)
7
+ end
8
+
9
+ describe :methods do
10
+ describe :get_competitions do
11
+ it "should return the correct array of names" do
12
+ @results_client.get_competitions.should == ["Austria Bundesliga "]
13
+ end
14
+ end
15
+
16
+ describe :get_competitions_with_id do
17
+ before do
18
+ @competitions = @results_client.get_competitions_with_id
19
+ @competition = @competitions.first
20
+ end
21
+
22
+ it "should return the correct amount of competitions" do
23
+ @competitions.size.should == 1
24
+ end
25
+
26
+ it "should return competitions with the correct fields" do
27
+ @competition.keys.should == [:name, :id]
28
+ end
29
+ end
30
+
31
+ describe :get_events_for_competition do
32
+ before do
33
+ @events = @results_client.get_events_for_competition(405366)
34
+ @event = @events.first
35
+ end
36
+
37
+ it "should return the correct amount of events" do
38
+ @events.size.should == 1
39
+ end
40
+
41
+ it "should return events with the correct fields" do
42
+ @event.keys.should == [:name, :time, :id]
43
+ end
44
+ end
45
+
46
+ describe :get_market_types_for_competition do
47
+ before do
48
+ @market_types = @results_client.get_market_types_for_competition(405366)
49
+ end
50
+
51
+ it "should return the correct market types" do
52
+ @market_types.should == ["Match", "Handicap USA", "Over/Under USA"]
53
+ end
54
+ end
55
+
56
+ describe :get_markets_for_competition do
57
+ before do
58
+ @markets = @results_client.get_markets_for_competition(405366, "Match")
59
+ @market = @markets.first
60
+ @option = @market.first
61
+ end
62
+
63
+ it "should return the correct number of markets" do
64
+ @markets.size.should == 1
65
+ end
66
+
67
+ it "should return the correct number of options inside the market" do
68
+ @market.size.should == 2
69
+ end
70
+
71
+ it "should return an option with id, player1, player2, tip and odds" do
72
+ @option.keys.should == [:id, :player1, :player2, :tip, :odds]
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe Interwetten::ResultsClient do
4
+ before do
5
+ stub_request(:any, /.*/).to_return(:body => mock_output("results.xml"))
6
+ @results_client = Interwetten::ResultsClient.new(666)
7
+ end
8
+
9
+ describe :methods do
10
+ describe :get_result do
11
+ before do
12
+ @result = @results_client.get_result(9754897)
13
+ end
14
+
15
+ it "should return the correct result" do
16
+ @result.should == "0:0"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'interwetten'
4
+ require 'webmock/rspec'
5
+ require "nokogiri"
6
+ require 'active_support/core_ext/object/to_query'
7
+
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+ config.treat_symbols_as_metadata_keys_with_true_values = true
12
+ config.run_all_when_everything_filtered = true
13
+ config.filter_run :focus
14
+
15
+ # Run specs in random order to surface order dependencies. If you find an
16
+ # order dependency and want to debug it, you can fix the order by providing
17
+ # the seed, which is printed after each run.
18
+ # --seed 1234
19
+ config.order = 'random'
20
+ end
@@ -0,0 +1,3 @@
1
+ def mock_output(name)
2
+ File.read("#{File.dirname(__FILE__)}/#{name}")
3
+ end
@@ -0,0 +1,14 @@
1
+ <FEED xmlns="" NAME="BettingOffers" DESCRIPTION="All current betting offers for the given kind of sports" LAST_REFRESH="2013-02-04T13:56:04" NEXT_REFRESH="2013-02-04T14:16:04" DOMAIN="www.interwetten.com" LANGUAGE="EN">
2
+ <KINDOFSPORT NAME="Basketball">
3
+ <LEAGUE NAME="Austria Bundesliga " ID="405366">
4
+ <EVENT NAME="BSC Raiffeisen Panthers Fürstenfeld - Guessing Knights" START_TIME="2013-02-04T19:00:00" OPEN_TILL="2013-02-04T19:00:00" EVENTID="9748669">
5
+ <BET ID="24013035" TYPEID="13" TYPENAME="Match" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld " PLAYER2="Guessing Knights" TIP="1" QUOTE="1,85"/>
6
+ <BET ID="24013034" TYPEID="13" TYPENAME="Match" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld " PLAYER2="Guessing Knights" TIP="2" QUOTE="1,85"/>
7
+ <BET ID="24137597" TYPEID="39" TYPENAME="Handicap USA" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld(-1.5) " PLAYER2="Guessing Knights(+1.5)" TIP="1" QUOTE="1,85"/>
8
+ <BET ID="24137598" TYPEID="39" TYPENAME="Handicap USA" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld(-1.5) " PLAYER2="Guessing Knights(+1.5)" TIP="2" QUOTE="1,85"/>
9
+ <BET ID="24013033" TYPEID="88" TYPENAME="Over/Under USA" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld - Guessing Knights" PLAYER2="Over 154.5" TIP=" " QUOTE="1,85"/>
10
+ <BET ID="24137599" TYPEID="88" TYPENAME="Over/Under USA" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld - Guessing Knights" PLAYER2="Over 154.5" TIP=" " QUOTE="1,85"/>
11
+ <BET ID="24137600" TYPEID="88" TYPENAME="Over/Under USA" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld - Guessing Knights" PLAYER2="Under 154.5" TIP=" " QUOTE="1,86"/>
12
+ <BET ID="24013032" TYPEID="88" TYPENAME="Over/Under USA" PLAYER1="BSC Raiffeisen Panthers Fürstenfeld - Guessing Knights" PLAYER2="Under 154.5" TIP=" " QUOTE="1,85"/>
13
+ </EVENT>
14
+ </LEAGUE>
@@ -0,0 +1,84 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <OFFERTREE TIMESTAMP="303357878" xmlns="">
3
+ <EVENT ID="9759528" CLONEID="9759527" STATE="L" STATEID="7" KINDOFSPORTID="1007" NAME="Nacional (live) - Barcelona (live)" SHORTNAME="Nacional - Barcelon" LEAGUEID="105120" LEAGUE_NAME="Copa Libertadores (90´)" LEAGUE_ORDER="3085" START_TIME="12.02.2013 23:15:00" MOD_TIMESTAMP="303357860" KOS_NAME="APUESTAS LIVE" SCORE="SoccerGoal=0 : 2|Half 1=0 : 2|Half 2=0 : 0|#Serving=-1 |#Penalty=0 : 0|Yellow Card=1 : 0" GAMETIME="52´" STATUS="Segundo tiempo" SHOW_SCOREBOARD="1" ICONID="14" SCOREBOARD_IMAGE="bg_10_1.jpg" TOPLEAGUE="0" DELAY="0" LIVE_KOSID="10" LIVE_KOSNAME="Fútbol" LIVE_KOS_ORDER="2">
4
+ <COLORINFO BG="0">
5
+ <HOME ICON="0" C1="0" C2="0" C3="0" />
6
+ <ROAD ICON="0" C1="0" C2="0" C3="0" />
7
+ </COLORINFO>
8
+ <LOG SHOWTIMES="1">
9
+ <ENTRY ID="5279160" SECONDS="12556" STATE="E" TYPE="34" DISPLAYTIME="40´" MESSAGE="Saque de esquina Nacional" />
10
+ <ENTRY ID="5279141" SECONDS="8721" STATE="E" TYPE="0" DISPLAYTIME="26´" MESSAGE="Goal by shot" />
11
+ <ENTRY ID="5279134" SECONDS="6902" STATE="E" TYPE="0" DISPLAYTIME="20´" MESSAGE="Goal by shot" />
12
+ <ENTRY ID="5279188" SECONDS="2760" STATE="E" TYPE="20" DISPLAYTIME="46´" MESSAGE="Segundo tiempo" />
13
+ <ENTRY ID="5279168" SECONDS="2700" STATE="E" TYPE="20" DISPLAYTIME="45´" MESSAGE="Descanso" />
14
+ <ENTRY ID="5279120" SECONDS="2524" STATE="E" TYPE="0" DISPLAYTIME="3´" MESSAGE="Saque de banda Barcelona" />
15
+ <ENTRY ID="5279116" SECONDS="1993" STATE="E" TYPE="0" DISPLAYTIME="1´" MESSAGE="Saque de puerta Barcelona" />
16
+ <ENTRY ID="5279115" SECONDS="1759" STATE="E" TYPE="0" DISPLAYTIME="1´" MESSAGE="Saque de falta Barcelona" />
17
+ <ENTRY ID="5279114" SECONDS="1712" STATE="E" TYPE="20" DISPLAYTIME="1´" MESSAGE="Saque inicial Barcelona" />
18
+ <ENTRY ID="5279142" SECONDS="1620" STATE="E" TYPE="19" DISPLAYTIME="27´" MESSAGE="Tarjeta amarilla Nacional" />
19
+ <ENTRY ID="5279140" SECONDS="1560" STATE="E" TYPE="17" DISPLAYTIME="26´" MESSAGE="Gol Barcelona" />
20
+ <ENTRY ID="5279132" SECONDS="1140" STATE="E" TYPE="17" DISPLAYTIME="19´" MESSAGE="Gol Barcelona" />
21
+ <ENTRY ID="5279112" SECONDS="0" STATE="E" TYPE="20" DISPLAYTIME="1´" MESSAGE="Comienzo de partido" />
22
+ </LOG>
23
+ </EVENT>
24
+ <EVENT ID="9759530" CLONEID="9759529" STATE="L" STATEID="1" KINDOFSPORTID="1007" NAME="Emelec (live) - Velez Sarsfield (live)" SHORTNAME="Emelec ( - Velez Sa" LEAGUEID="105120" LEAGUE_NAME="Copa Libertadores (90´)" LEAGUE_ORDER="3085" START_TIME="13.02.2013 01:30:00" MOD_TIMESTAMP="303357065" KOS_NAME="APUESTAS LIVE" SCORE="SoccerGoal=0 : 0|Half 1=0 : 0|Half 2=0 : 0|#Serving=-1 |#Penalty=0 : 0" GAMETIME="13.02.2013 01:30:00" STATUS="" SHOW_SCOREBOARD="1" ICONID="14" SCOREBOARD_IMAGE="bg_10_1.jpg" TOPLEAGUE="0" DELAY="0" LIVE_KOSID="10" LIVE_KOSNAME="Fútbol" LIVE_KOS_ORDER="2">
25
+ <COLORINFO BG="0">
26
+ <HOME ICON="0" C1="0" C2="0" C3="0" />
27
+ <ROAD ICON="0" C1="0" C2="0" C3="0" />
28
+ </COLORINFO>
29
+ </EVENT>
30
+ <EVENT ID="9760158" CLONEID="9759228" STATE="L" STATEID="12" KINDOFSPORTID="1007" NAME="Becker B. (LIVE) - Harrison R. (LIVE)" SHORTNAME="Becker B - Harrison" LEAGUEID="115068" LEAGUE_NAME="ATP San Jose" LEAGUE_ORDER="36" START_TIME="12.02.2013 22:45:00" MOD_TIMESTAMP="303357868" KOS_NAME="APUESTAS LIVE" SCORE="Game=5 : 4|InGame=30 : 40|Tiebreak=0 : 0|Ace=0 : 0|DblFault=0 : 0|Break=1 : 1|Sets=0 : 1|#Serving=1 |Set 1=6 : 7|Set 2=5 : 4" GAMETIME="94´" STATUS="Segundo set" SHOW_SCOREBOARD="1" ICONID="15" SCOREBOARD_IMAGE="bg_11_1.jpg" TOPLEAGUE="0" DELAY="0" LIVE_KOSID="11" LIVE_KOSNAME="Tenis" LIVE_KOS_ORDER="1">
31
+ <COLORINFO BG="0">
32
+ <HOME ICON="6" C1="ffffff" C2="0" C3="ffffff" />
33
+ <ROAD ICON="6" C1="ffffff" C2="ffffff" C3="ffffff" />
34
+ </COLORINFO>
35
+ <LOG SHOWTIMES="0">
36
+ <ENTRY ID="5279194" SECONDS="36772" STATE="E" TYPE="0" DISPLAYTIME="92´" MESSAGE="1° Punto Harrison R." />
37
+ <ENTRY ID="5279191" SECONDS="36172" STATE="E" TYPE="0" DISPLAYTIME="90´" MESSAGE="Game:30 Becker B." />
38
+ <ENTRY ID="5279189" SECONDS="35096" STATE="E" TYPE="0" DISPLAYTIME="87´" MESSAGE="1° Punto Becker B." />
39
+ <ENTRY ID="5279186" SECONDS="34813" STATE="E" TYPE="0" DISPLAYTIME="87´" MESSAGE="Game:30 Harrison R." />
40
+ <ENTRY ID="5279185" SECONDS="33924" STATE="E" TYPE="0" DISPLAYTIME="85´" MESSAGE="1° Punto Harrison R." />
41
+ <ENTRY ID="5279184" SECONDS="33337" STATE="E" TYPE="0" DISPLAYTIME="83´" MESSAGE="Game:15 Becker B." />
42
+ <ENTRY ID="5279182" SECONDS="32479" STATE="E" TYPE="0" DISPLAYTIME="81´" MESSAGE="1° Punto Harrison R." />
43
+ <ENTRY ID="5279181" SECONDS="32224" STATE="E" TYPE="0" DISPLAYTIME="80´" MESSAGE="Game after Deuce Harrison R." />
44
+ <ENTRY ID="5279177" SECONDS="30193" STATE="E" TYPE="0" DISPLAYTIME="75´" MESSAGE="1° Punto Becker B." />
45
+ <ENTRY ID="5279174" SECONDS="29556" STATE="E" TYPE="0" DISPLAYTIME="73´" MESSAGE="Game after Deuce Becker B." />
46
+ <ENTRY ID="5279170" SECONDS="28443" STATE="E" TYPE="0" DISPLAYTIME="71´" MESSAGE="1° Punto Becker B." />
47
+ <ENTRY ID="5279169" SECONDS="28215" STATE="E" TYPE="0" DISPLAYTIME="70´" MESSAGE="Game:15 Harrison R." />
48
+ <ENTRY ID="5279167" SECONDS="27624" STATE="E" TYPE="0" DISPLAYTIME="69´" MESSAGE="1° Punto Harrison R." />
49
+ <ENTRY ID="5279165" SECONDS="26992" STATE="E" TYPE="0" DISPLAYTIME="67´" MESSAGE="Game after Deuce Becker B." />
50
+ <ENTRY ID="5279156" SECONDS="23837" STATE="E" TYPE="0" DISPLAYTIME="59´" MESSAGE="1° Punto Harrison R." />
51
+ <ENTRY ID="5279155" SECONDS="23492" STATE="E" TYPE="0" DISPLAYTIME="58´" MESSAGE="Game:0 Harrison R." />
52
+ <ENTRY ID="5279153" SECONDS="22919" STATE="E" TYPE="0" DISPLAYTIME="57´" MESSAGE="1° Punto Harrison R." />
53
+ <ENTRY ID="5279152" SECONDS="22519" STATE="E" TYPE="0" DISPLAYTIME="55´" MESSAGE="Game:30 Becker B." />
54
+ <ENTRY ID="5279150" SECONDS="21650" STATE="E" TYPE="0" DISPLAYTIME="53´" MESSAGE="1° Punto Becker B." />
55
+ <ENTRY ID="5279147" SECONDS="20850" STATE="E" TYPE="0" DISPLAYTIME="51´" MESSAGE="Segundo set" />
56
+ <ENTRY ID="5279146" SECONDS="20823" STATE="E" TYPE="21" DISPLAYTIME="51´" MESSAGE="Set Harrison R." />
57
+ <ENTRY ID="5279145" SECONDS="20737" STATE="E" TYPE="0" DISPLAYTIME="51´" MESSAGE="Tiebreak 3 : 7 Harrison R." />
58
+ <ENTRY ID="5279139" SECONDS="18016" STATE="E" TYPE="0" DISPLAYTIME="45´" MESSAGE="Break:30 Harrison R." />
59
+ <ENTRY ID="5279135" SECONDS="16686" STATE="E" TYPE="0" DISPLAYTIME="42´" MESSAGE="1° Punto Becker B." />
60
+ <ENTRY ID="5279131" SECONDS="16064" STATE="E" TYPE="0" DISPLAYTIME="40´" MESSAGE="Break after Deuce Becker B." />
61
+ <ENTRY ID="5279126" SECONDS="13938" STATE="E" TYPE="0" DISPLAYTIME="35´" MESSAGE="1° Punto Becker B." />
62
+ <ENTRY ID="5279125" SECONDS="13645" STATE="E" TYPE="0" DISPLAYTIME="34´" MESSAGE="Game:30 Becker B." />
63
+ <ENTRY ID="5279124" SECONDS="12471" STATE="E" TYPE="0" DISPLAYTIME="31´" MESSAGE="1° Punto Harrison R." />
64
+ <ENTRY ID="5279123" SECONDS="11864" STATE="E" TYPE="0" DISPLAYTIME="29´" MESSAGE="Game:30 Harrison R." />
65
+ <ENTRY ID="5279119" SECONDS="10491" STATE="E" TYPE="0" DISPLAYTIME="25´" MESSAGE="1° Punto Harrison R." />
66
+ <ENTRY ID="5279118" SECONDS="10118" STATE="E" TYPE="0" DISPLAYTIME="25´" MESSAGE="Game:30 Becker B." />
67
+ <ENTRY ID="5279111" SECONDS="9227" STATE="E" TYPE="0" DISPLAYTIME="22´" MESSAGE="1° Punto Harrison R." />
68
+ <ENTRY ID="5279109" SECONDS="8582" STATE="E" TYPE="0" DISPLAYTIME="21´" MESSAGE="Game after Deuce Harrison R." />
69
+ <ENTRY ID="5279106" SECONDS="6875" STATE="E" TYPE="0" DISPLAYTIME="16´" MESSAGE="1° Punto Becker B." />
70
+ <ENTRY ID="5279103" SECONDS="6585" STATE="E" TYPE="0" DISPLAYTIME="15´" MESSAGE="Game:0 Becker B." />
71
+ <ENTRY ID="5279102" SECONDS="6084" STATE="E" TYPE="0" DISPLAYTIME="14´" MESSAGE="1° Punto Becker B." />
72
+ <ENTRY ID="5279100" SECONDS="5271" STATE="E" TYPE="0" DISPLAYTIME="12´" MESSAGE="Game:30 Harrison R." />
73
+ <ENTRY ID="5279098" SECONDS="4384" STATE="E" TYPE="0" DISPLAYTIME="10´" MESSAGE="1° Punto Harrison R." />
74
+ <ENTRY ID="5279097" SECONDS="4136" STATE="E" TYPE="0" DISPLAYTIME="9´" MESSAGE="Game:15 Becker B." />
75
+ <ENTRY ID="5279096" SECONDS="3471" STATE="E" TYPE="0" DISPLAYTIME="8´" MESSAGE="1° Punto Harrison R." />
76
+ <ENTRY ID="5279093" SECONDS="2769" STATE="E" TYPE="0" DISPLAYTIME="5´" MESSAGE="Game:15 Harrison R." />
77
+ <ENTRY ID="5279092" SECONDS="2168" STATE="E" TYPE="0" DISPLAYTIME="4´" MESSAGE="1° Punto Harrison R." />
78
+ <ENTRY ID="5279091" SECONDS="1923" STATE="E" TYPE="0" DISPLAYTIME="3´" MESSAGE="Game:30 Becker B." />
79
+ <ENTRY ID="5279088" SECONDS="1019" STATE="E" TYPE="0" DISPLAYTIME="1´" MESSAGE="1° Punto Harrison R." />
80
+ <ENTRY ID="5279087" SECONDS="833" STATE="E" TYPE="0" DISPLAYTIME="1´" MESSAGE="Game Harrison R." />
81
+ <ENTRY ID="5279085" SECONDS="629" STATE="E" TYPE="0" DISPLAYTIME="0´" MESSAGE="Primer set" />
82
+ </LOG>
83
+ </EVENT>
84
+ </OFFERTREE>
@@ -0,0 +1,8 @@
1
+ <FEED xmlns="" NAME="EventResults" DESCRIPTION="The event results of all events during the last 10 days displayed in the language '@LANGUAGE'. You can specify a list of sport kinds, a list of leagues, or both." LAST_REFRESH="2013-02-06T12:56:16" NEXT_REFRESH="2013-02-06T13:06:16" DOMAIN="www.interwetten.com" LANGUAGE="EN">
2
+ <KINDOFSPORT NAME="Football">
3
+ <LEAGUE NAME="African Cup of Nations (South Africa) (90´)">
4
+ <EVENT NAME="Burkina Faso - Togo" ID="9754897" RESULT="0:0" START_FROM="2013-02-03T19:30:00"/>
5
+ </EVENT>
6
+ </LEAGUE>
7
+ </KINDOFSPORT>
8
+ </FEED>
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: interwetten
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Cristian Planas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: active_support
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: A Ruby wrapper for the Interwetten API
98
+ email:
99
+ - me@cristianplanas.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - .gitignore
105
+ - .rspec
106
+ - Gemfile
107
+ - LICENSE.txt
108
+ - README.md
109
+ - Rakefile
110
+ - interwetten.gemspec
111
+ - lib/interwetten.rb
112
+ - lib/interwetten/clients.rb
113
+ - lib/interwetten/clients/livescore_client.rb
114
+ - lib/interwetten/clients/markets_client.rb
115
+ - lib/interwetten/clients/results_client.rb
116
+ - lib/interwetten/common_methods.rb
117
+ - lib/interwetten/version.rb
118
+ - spec/interwetten/clients/livescore_client_spec.rb
119
+ - spec/interwetten/clients/markets_client_spec.rb
120
+ - spec/interwetten/clients/results_client_spec.rb
121
+ - spec/spec_helper.rb
122
+ - spec/support/aux_methods.rb
123
+ - spec/support/events.xml
124
+ - spec/support/livescore.xml
125
+ - spec/support/results.xml
126
+ homepage: ''
127
+ licenses:
128
+ - MIT
129
+ metadata: {}
130
+ post_install_message:
131
+ rdoc_options: []
132
+ require_paths:
133
+ - lib
134
+ required_ruby_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ requirements: []
145
+ rubyforge_project:
146
+ rubygems_version: 2.1.8
147
+ signing_key:
148
+ specification_version: 4
149
+ summary: A Ruby wrapper for the Interwetten API
150
+ test_files:
151
+ - spec/interwetten/clients/livescore_client_spec.rb
152
+ - spec/interwetten/clients/markets_client_spec.rb
153
+ - spec/interwetten/clients/results_client_spec.rb
154
+ - spec/spec_helper.rb
155
+ - spec/support/aux_methods.rb
156
+ - spec/support/events.xml
157
+ - spec/support/livescore.xml
158
+ - spec/support/results.xml