Created
December 26, 2011 01:43
-
-
Save redtower/1520367 to your computer and use it in GitHub Desktop.
Google位置情報サービスから住所を取得するスクリプト
This file contains 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
#!/bin/bash | |
# http://blog.indonesiancoder.com/google-gears-wifi-geolocation-api-query | |
# http://www.guilz.org/2011/11/28/google位置情報サービスから住所を取得する/ | |
if [ $# != 2 ]; then | |
echo "# Google Gears WiFi Geolocation API query by ShadowHat=esYou" | |
echo "# Shadow@SquatThis.net" | |
echo "#" | |
echo "# Use: $0 MAC1 MAC2" | |
echo "# $0 00-C0-26-A9-42-F7 00-C0-26-A9-42-F8" | |
echo "#" | |
exit; | |
fi; | |
curl http://www.google.com/loc/json \ | |
-H "Pragma: no-cache" \ | |
-H "Cache-control: no-cache" \ | |
-d "{ | |
\"version\": \"1.1.0\", | |
\"host\": \"maps.google.com\", | |
\"request_address\": true, | |
\"address_language\": \"ja_JP\", | |
\"wifi_towers\": [ | |
{ \"mac_address\": \"$1\", \"signal_strength\": 8, \"age\": 0 }, | |
{ \"mac_address\": \"$2\", \"signal_strength\": 8, \"age\": 0 } | |
] }" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment