#!/bin/sh
USER=my_username
PASS=my_password
COOKIES=/tmp/wiglecookies
CACHEROOT=/tmp/wiglecache.
for n in `iwlist wlan0 scan | awk '/Address/ {print $5;}'`; do
# '/Signal level/ {print id " " $3;}'
CACHEFILE=${CACHEROOT}$n;
echo check netid $n
if [ ! -e ${CACHEFILE} ]; then
echo looking up $n
if [ ! -e ${COOKIES} ]; then
wget --save-cookies=${COOKIES} --no-check-certificate \
'https://wigle.net/gps/gps/GPSDB/login?credential_0='${USER}'&credential_1='${PASS}'&noexpire=1'
2>/dev/null
fi
POS=`wget --load-cookies=${COOKIES} --no-check-certificate \
'https://wigle.net/gpsopen/gps/GPSDB/confirmquery?netid='${n} -O- 2>/dev/null|
awk 'BEGIN {FS="[&?=]";} /Get Map/ { print $4 "," $6; }'`
if [ -n "${POS}" ]; then
echo -n "${POS}" > ${CACHEFILE}
fi
fi
if [ -e ${CACHEFILE} ]; then
echo $n: `cat ${CACHEFILE}`;
else
echo $n: not found;
fi
done
| The Following 3 Users Say Thank You to tme For This Useful Post: | ||