Last active
November 28, 2016 21:26
-
-
Save nrshrivatsan/974f19f9779a81c2c5f6 to your computer and use it in GitHub Desktop.
Julia lang - Read JSON from URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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