Last active
April 20, 2018 06:05
-
-
Save dhoeric/78e0dab712cc4529c0ce to your computer and use it in GitHub Desktop.
Get geographic location by IP address #scripts
This file contains hidden or 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
# Put into .bashrc, source .bashrc, (max. 1000 requests per day) | |
# Example: | |
# $ ip2geo 8.8.8.8 | |
# { | |
# "ip": "8.8.8.8", | |
# "hostname": "google-public-dns-a.google.com", | |
# "city": "Mountain View", | |
# "region": "California", | |
# "country": "US", | |
# "loc": "37.3860,-122.0838", | |
# "org": "AS15169 Google Inc.", | |
# "postal": "94040" | |
# } | |
ip2geo () { /usr/bin/curl ipinfo.io/$@ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment