Hacker News new | past | comments | ask | show | jobs | submit login

one single cmd wee

MYMAC=$(arp -a | awk '/[0-9a-f]:/ { gsub(/^0:|[1-9a-z]0:/, "00:", $4); gsub(/:/, "", $4); print $4; exit; }') && curl --header "Content-Type: text/xml" --data "<?xml version='1.0'?><LocationRQ xmlns='http://skyhookwireless.com/wps/2005' version='2.6' street-address-lookup='full'><authentication version='2.0'><simple><username>beta</username><realm>js.loki.com</realm></simple></authentication><access-point><mac>$MYMAC</mac><signal-strength>-50</signal-strength></access-point></LocationRQ>" https://api.skyhookwireless.com/wps2/location

had to change 0: to 00: and strip out those :'s




:P or rather,

curl --header "Content-Type: text/xml" --data "<?xml version='1.0'?><LocationRQ xmlns='http://skyhookwireless.com/wps/2005' version='2.6' street-address-lookup='full'><authentication version='2.0'><simple><username>beta</username><realm>js.loki.com</realm></simple></authentication><access-point><mac>$(arp -a | awk '/[0-9a-f]:/ { gsub(/^0:|:0:/, "00:", $4); gsub(/:/, "", $4); print $4; exit; }')</mac><signal-strength>-50</signal-strength></access-point></LocationRQ>" https://api.skyhookwireless.com/wps2/location


Our wonderful scripting adventures don't seem to work anymore... ;( Anyone able to confirm?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: