Skip to content

Instantly share code, notes, and snippets.

View Nucc's full-sized avatar
🐭
Coding

Laszlo Papp Nucc

🐭
Coding
View GitHub Profile
@Nucc
Nucc / gist:618191
Created October 9, 2010 13:52 — forked from stef/gist:591436
# 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