adtac / climate

The swiss-army knife of utility tools for Linux.
GNU General Public License v3.0
1.43k stars 76 forks source link

Added ipinfo.io support #23

Closed Gurkengewuerz closed 7 years ago

Gurkengewuerz commented 7 years ago

Added the API from ipinfo.io. To make it work i had to add jq to decode the json response. If someone has a better option please say it.

Example:

root@MVS1936:~# climate ipinfo
+ curl --silent https://ipinfo.io/
IP-Address: 130.180.88.76
Hostname: b2b-130-180-88-76.unitymedia.biz
Network: AS6830 Liberty Global Operations B.V.
City: Dortmund, North Rhine-Westphalia, DE
Postal Code: 44143
Latitude/Longitude: 51.5208,7.5184

root@MVS1936:~# climate ipinfo 198.41.214.162
+ curl --silent https://ipinfo.io/198.41.214.162
IP-Address: 198.41.214.162
Hostname: No Hostname
Network: AS13335 Cloudflare, Inc.
City: San Francisco, California, US
Postal Code: 94107
Latitude/Longitude: 37.7697,-122.3933
Gurkengewuerz commented 7 years ago

@adtac noticed the PR?

adtac commented 7 years ago

Hey @Gurkengewuerz

Sorry about that, I must have missed the notification somehow. Anyway, I left a tiny review comment. If that's patched up, we're good to go :)

Gurkengewuerz commented 7 years ago

@adtac done ;)

adtac commented 7 years ago

Cheers, thanks! Merged it :+1: