Skip to content

Instantly share code, notes, and snippets.

@digizeph
Created September 11, 2013 08:43
Show Gist options
  • Select an option

  • Save digizeph/6520927 to your computer and use it in GitHub Desktop.

Select an option

Save digizeph/6520927 to your computer and use it in GitHub Desktop.
one-line command to extract coordinate from the given domain name. geopy python packet is needed.
for var in "$@"; do python -c "from geopy import geocoders as gc; from sys import ar gv;_,lat = gc.GoogleV3().geocode(' '.join(argv[1:])); print lat[0],lat[1]" $(whois $ (nslookup $var|grep Address|sed -n 2p| cut -f 2|sed 's/#.*//') | grep 'City\|State' | awk '{print $2}' | xargs -n 2) ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment