Skip to content

Instantly share code, notes, and snippets.

@Usse
Created November 7, 2012 15:03
Show Gist options
  • Save Usse/4032117 to your computer and use it in GitHub Desktop.
Save Usse/4032117 to your computer and use it in GitHub Desktop.
Example of Ruby xmlsimple
require 'net/http'
require 'rubygems'
require 'xmlsimple'
xmlUrl = 'http://opendata.5t.torino.it/get_pk'
xml_data = Net::HTTP.get_response(URI.parse(xmlUrl)).body
data = XmlSimple.xml_in(xml_data)
data['PK_data'].each do |item|
#puts item.inspect
puts "#{item['ID']} : #{item['Name']} = #{item['Free']}"
end
@Usse
Copy link
Author

Usse commented Nov 7, 2012

Usage

ruby park.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment