Created
May 2, 2015 06:52
-
-
Save adeekshith/8c55b3b8f7b2891e300c to your computer and use it in GitHub Desktop.
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
(* Gets JSON from a URL and extracts the data *) | |
(* Gets response in JSON format *) | |
apiResponse1 = Import["http://****shod.com/logdata/dessfaa/predictlocation", "JSON"]; | |
(* Check returns 0 if an error occurs and Quiet supresses displaying errors *) | |
Quiet@Check[apiResponse1, 0] | |
(* Get response from JSON hierarchically *) | |
"latitude" /. ("prediction" /. apiResponse1) | |
(* latitude and prediction are the data keys in the JSON *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment