Created
December 19, 2013 00:08
-
-
Save yetithefoot/8032084 to your computer and use it in GitHub Desktop.
IP Geolocation shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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