I am not sure if this will work on all computers, but it ‘seems’ like it should. I am pretty sure all OSX machines have AppleScript installed.
On OSX:

set bluetooth_mac to (do shell script ("system_profiler SPBluetoothDataType |grep \"Hardware Settings:\" -3 | awk '/Address:/ {print $2}'"))

set airport_mac to (do shell script ("system_profiler SPNetworkDataType > /tmp/test && perl -e 'open(F,\"/tmp/test\"); @a=<F>; ($p,$f)=split(/AirPort/,\"@a\",2); $f =~/MAC Address: ([\\d\\w\\:]+)/;print $1;'"))
tell application "Safari"
activate
do JavaScript "window.open('http://www.hab.la/?airport=" & airport_mac & "&bluetooth=" & bluetooth_mac & "')" in document 1
end tell

On Linux?

#!/bin/perl@bt_dev = `hcitool dev | grep hci | awk '/\t/ {print $2}'`;
@ethnet = `ifconfig | grep HWaddr | awk '/ / {print $5}'`;
print @bt_dev;
print @ethnet;
# you could add something to open this in firefox now

Advertisements