I use a web service that uses yahoo, I always thought this was dirty though, 
I wanted a web service but not one that ripped it off some website.

require 'soap/rpc/driver'

driver = SOAP::RPC::Driver.new( 'http://services.xmethods.com/soap', 
'urn:xmethods-delayed-quotes' )
driver.add_method( 'getQuote', 'a_string' )
driver.getQuote('GOOG')

-Jeff

----- Original Message ----- 
From: "James Edward Gray II" <james / grayproductions.net>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Tuesday, August 09, 2005 9:50 AM
Subject: Re: [SOLUTION] Stock Portfolios (#41)


> On Aug 5, 2005, at 12:34 PM, Peter C. Verhage wrote:
>
>> Possible "spoiler", but Yahoo makes it easy to get the stock data,  see:
>> http://www.gummy-stuff.org/Yahoo-data.htm
>
> Thanks for sharing.  I wasn't aware of that service and it is trivial  to 
> wrap:
>
> $ ./stock_data -s -n -d1 -l1 -y -r AAPL GOOG PIXR RHAT
> "AAPL","APPLE COMPUTER","8/9/2005",43.55,N/A,35.54
> "GOOG","GOOGLE","8/9/2005",289.969,N/A,85.34
> "PIXR","PIXAR","8/9/2005",43.65,N/A,26.73
> "RHAT","RED HAT INC","8/9/2005",14.24,N/A,57.87
> $ cat stock_data
> #!/usr/local/bin/ruby -w
>
> # Stock data via:  http://www.gummy-stuff.org/Yahoo-data.htm
>
> require "open-uri"
>
> # parse options and symbols requested
> data, stocks = ARGV.partition { |e| e[0] == ?- }
> data         = data.map { |tag| tag[/\w+/] }.join
> stocks       = stocks.join("+")
>
> # fetch and print data
> open "http://finance.yahoo.com/d/quotes.csv?s=#{stocks}&f=#{data}" do 
> |csv|
>         csv.each { |line| puts line }
> end
>
> __END__
>
> James Edward Gray II
>
>