Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia lang - How to read JSON from HTTP URL

Goal

How to read a JSON from HTTP URL using Julia-lang?

like image 531
suryakrupa Avatar asked Jun 06 '15 21:06

suryakrupa


1 Answers

Code

#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%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"])

Git Gist

like image 135
suryakrupa Avatar answered Sep 28 '22 20:09

suryakrupa