Last active
December 17, 2015 14:49
-
-
Save arnar/5627777 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
arnar@air:/tmp$ cat lennartsurl.json | |
{"totalPoints":14395,"version":1,"rounds":[["round","lat","lng","gLat","gLng","cLat",[null],"cLng",[null],"points"],[1,53.774101,87.18442600000003,46.07323062540838,4.21875,0,0,1337],[2,-31.704593,137.22421099999997,-26.431228064506424,132.890625,0,0,2296],[3,46.165393,14.310496999999941,47.754097979680026,14.58984375,0,0,2845],[4,22.218447,114.211588,22.375476015564765,114.1534423828125,0,0,5210],[5,-15.780246,-47.92931199999998,-13.923403897723334,-49.21875,0,0,2707]],"isChallenge":false,"challengeScore":null} | |
arnar@air:/tmp$ for url in $(cat lennartsurl.json \ | |
| jq -r '.rounds[1:][] | @uri "http://maps.googleapis.com/maps/api/geocode/json?latlng=\(.[1]),\(.[2])&sensor=true"'); do \ | |
curl -s $url | jq '.results[0].formatted_address'; \ | |
done | |
"ulitsa Vodopadnaya, Novokuznetsk, Kemerovo Oblast, Russia, 654000" | |
"Stuart Highway, Mount Gunson SA 5710, Australia" | |
"Studenec 11, 4220 Škofja Loka, Slovenia" | |
"5 Stanley Main Street, Stanley, Hong Kong" | |
"Estrada Parque Contorno do Bosque - Cruzeiro, Brasília - Federal District, Brazil" | |
arnar@air:/tmp$ # And now your guesses: | |
arnar@air:/tmp$ arnar@air:/tmp$ for url in $(cat lennartsurl.json \ | |
| jq -r '.rounds[1:][] | @uri "http://maps.googleapis.com/maps/api/geocode/json?latlng=\(.[3]),\(.[4])&sensor=true"'); do \ | |
curl -s $url | jq '.results[0].formatted_address'; \ | |
done | |
"L'Étang, 42460 Coutouvre, France" | |
"Pukatja Homeland SA 0872, Australia" | |
"Unterlaussa 75, 8934 Unterlaussa, Austria" | |
"Shing Mun Tunnel Road, Hong Kong" | |
"GO-151 - Amaralina - Goiás, Brazil" | |
arnar@air:/tmp$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment