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
# Linux | |
for mac in $(iwlist wlan0 scan | grep -o 'Address: .*' | cut -d' ' -f2); do curl -d '{version:"1.1.0",request_address:true,wifi_towers:[{mac_address:"'$mac'"}]}' www.google.com/loc/json; done | |
# Osx (for all access points) | |
for mac in $( /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s | grep -o "\([0-9a-f]\{2\}:\)\{5\}[0-9a-f]\{2\}" ); do curl -d '{version:"1.1.0",request_address:true,wifi_towers:[{mac_address:"'$mac'"}]}' www.google.com/loc/json; done | |
# Osx (connected access point) | |
for mac in $(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep -o "\([0-9a-f]\{1,2\}:\)\{5\}[0-9a-f]\{1,2\}"); do curl -d '{version:"1.1.0",request_address:true,wifi_towers:[{mac_address:"'$mac'"}]}' www.google.com/loc/json; done |