s🇷
#!/bin/sh
#-*- coding: utf-8 -*-
# Exit the script on errors:
set -e
trap 'echo "$0 FAILED at line ${LINENO}"' ERR
# Catch unitialized variables:
set -u
#~ cd $(dirname ${0})
mac=`echo ${1}|tr -d ":"`
res1=`curl -i -s -k -X 'POST' \
-H 'User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.1; Nexus 5 Build/LRX22C)' -H 'Content-Type: application/x-www-form-urlencoded' \
"http://mobile.maps.yandex.net/cellid_location/?clid=1866854&lac=-1&cellid=-1&operatorid=null&countrycode=null&signalstrength=-1&wifinetworks=${mac}:-65&app=ymetro" \
| grep coordinates`
lat=`echo $res1|awk -F" " '{print $2}'|awk -F"=" '{print $2}'|tr -d '"'`
long=`echo $res1|awk -F" " '{print $3}'|awk -F"=" '{print $2}'|tr -d '"'`
echo $lat $long
xdg-open https://www.google.com/search?q="$lat $long"