Skip to content

Instantly share code, notes, and snippets.

@livando
Created November 30, 2012 14:14
Show Gist options
  • Select an option

  • Save livando/4175993 to your computer and use it in GitHub Desktop.

Select an option

Save livando/4175993 to your computer and use it in GitHub Desktop.
Pulling stock dividend from google finance
require 'json'
require 'open-uri'
url = "http://www.google.com/finance/info?infotype=infoquoteall&q=goog"
json = open(url).read[3..-1]
result = JSON.parse json
result.first["yld"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment