Skip to content

Instantly share code, notes, and snippets.

@nrshrivatsan
Last active November 28, 2016 21:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nrshrivatsan/974f19f9779a81c2c5f6 to your computer and use it in GitHub Desktop.
Save nrshrivatsan/974f19f9779a81c2c5f6 to your computer and use it in GitHub Desktop.
Julia lang - Read JSON from URL
#Importing Requests package
Pkg.add("Requests")
using Requests.get;
import JSON;
url = "http://query.yahooapis.com/v1/public/yql?q=select%20DaysRange%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22EBAY%22,%22GOOG%22%29%20&env=http://datatables.org/alltables.env&format=json";
#Reads the data from HTTP URL
es = get(url);
j = JSON.parse(es.data)
#Prints the data from JSON
print(j["query"]["results"]["quote"])
for i in (j["query"]["results"]["quote"])
print((i["DaysRange"]))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment