Skip to content

Instantly share code, notes, and snippets.

@jrpz
Created August 6, 2010 21:58

Revisions

  1. jrpz created this gist Aug 6, 2010.
    10 changes: 10 additions & 0 deletions yql_finance.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    require 'json'
    require 'open-uri'

    url = 'http://query.yahooapis.com/v1/public/yql?format=json&env=http://datatables.org/alltables.env&callback=cbfunc&q='

    query = 'QUERY = SELECT * FROM yahoo.finance.quotes WHERE symbol IN (“YHOO”,“AAPL”,“GOOG”,“MSFT”)'

    quri = URI.encode(url + query)

    doc = open(quri)