box-o-sand/cookbook/016/04.rb

11 lines
274 B
Ruby
Raw Normal View History

2011-11-18 14:03:28 +00:00
require 'soap/rpc/driver'
# doesn't work (service no longer available?)
driver = SOAP::RPC::Driver.new(
'http://services.xmethods.net/soap/', 'url:xmethods-delayed-quotes'
)
driver.add_method('getQuote', 'symbol')
puts 'Stock price: %.2f' % driver.getQuote(ARGV.first)