Thread: Get GPS Location from terminal
you have have curl installed
http://foss-boss.blogspot.com/2010/0...on-street.html
enter following in terminal. should tell locationthe following code works if:
- run in root shell (ubuntu users do: "sudo -i" paste it)
- connected via wifi access point
- wireless adapter called wlan0 (otherwise replace correct name)
- you're using linux system or similar (i.e. windows won't work here)
/bin/echo '{"version": "1.1.0","host": "maps.google.com","request_address": true,"address_language": "en_gb", "wifi_towers": [{"mac_address": "' $( iwlist wlan0 scan | grep address | head -1 | awk '{print $5}' | sed -e 's/ //g' ) '","signal_strength": 8,"age": 0}]}' | sed -e 's/" /"/' -e 's/ "/"/g' > /tmp/post.$$ && curl -x post -d @/tmp/post.$$ http://www.google.com/loc/json | sed -e 's/{/\n/g' -e 's/,/\n/gps: if returned information wrong, or kind of "unknown" .. consider lucky, lucky! means google not (yet?) know wifi ap is. rest of .. tin-foil way
good heavens, , people this? hello? you're running big blob of obfuscated code root!
Forum The Ubuntu Forum Community Ubuntu Community Discussions The Cafe Get GPS Location from terminal
Ubuntu
Comments
Post a Comment