Skip to content

Instantly share code, notes, and snippets.

@yetithefoot
Created December 19, 2013 00:08
Show Gist options
  • Save yetithefoot/8032084 to your computer and use it in GitHub Desktop.
Save yetithefoot/8032084 to your computer and use it in GitHub Desktop.
IP Geolocation shell script
# Uses curl for getting location object from telize.com
# Next it uses jq (http://stedolan.github.io/jq/) json parser to extract city and country name
# get current location name based on request IP
curl -s http://www.telize.com/geoip | jq '.city +", "+ .country'
# get location name based on parameter value from request
curl -s http://www.telize.com/geoip/8.8.8.8 | jq '.city +", "+ .country'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment