I got bored the other day and decided that I wanted a page that I could query via a bash script and it would tell me my public IP address. Yes I know there are plenty of site that have this but I wanted my own.
Here is the lookup page: http://motersho.com/blog/index.php/geoip-lookup/
Well that idea then manifested itself to a place where I can get City, State, Country and Longitude/Latititude coordiates of that IP address. So, I wrote two pages one that uses the MaxMind API and thier Free IP to City database and the other uses HostIP’s API and their database to do Geo lookups and using the Google Maps API for maping that location.
The HostIP database is not as complete as the as MaxMind‘s so they as that if you come across an unknown address you help them out by updating that info. Please help them out.
My site still has the ability to to just return your public IP address for scripting, you just have to pass it the correct parameter.
For scripting: http://motersho.com/ip/?o
Here is the code to return you public IP in a bash script
curl http://motersho.com/ip/?o
Leave me a comment if you use this site in a script or if you have found it useful in any other way.