Skip to content

Instantly share code, notes, and snippets.

@Nucc
Forked from stef/gist:591436
Created October 9, 2010 13:52
Show Gist options
  • Save Nucc/618191 to your computer and use it in GitHub Desktop.
Save Nucc/618191 to your computer and use it in GitHub Desktop.
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment