Skip to content

Instantly share code, notes, and snippets.

@Rokko11
Created August 10, 2013 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rokko11/6201990 to your computer and use it in GitHub Desktop.
Save Rokko11/6201990 to your computer and use it in GitHub Desktop.
Getting Information of OpenLigaDb with Ruby in a Rails project
# This snippet works with Ruby Gem "Savon"
client = Savon.client(wsdl: "http://www.OpenLigaDB.de/Webservices/Sportsdata.asmx?WSDL")
method = "get_matchdata_by_league_date_time"
message = {from_date_time: 5.hours.ago, to_date_time: Time.now, league_shortcut: 'bl1'}
result = client.call(:"#{method}", message: message)
data_array = result.body[:"#{method}_response"][:"#{method}_result"][:matchdata]
data_array.each do |data|
puts data[:match_id]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment