Hacker News new | ask | show | jobs
by WillySchu 3409 days ago
Using this, a command that will get your public IP, geo locate it, and then get an uber pickup time for those coordinates.

dig +short myip.opendns.com @resolver1.opendns.com | xargs -I {} echo "ipinfo.io/"{} | xargs curl | grep loc | cut -d: -f2 | sed "s/,$//" | xargs uber time

2 comments

Nice ipinfo.io mashup! This whole part

    dig +short myip.opendns.com @resolver1.opendns.com | xargs -I {} echo "ipinfo.io/"{} | xargs curl | grep loc | cut -d: -f2 | sed "s/,$//"
can be simplified to

    curl ipinfo.io/loc
which gives you exactly the same information, per https://ipinfo.io/developers

But ip geolocation usually gives you city or zipcode level accuracy, which may or may not be good enough to get an accurate uber estimate depending on how big your city/zip area is.

too bad IP geolocation is pretty bad. if you're lucky you'll get the city correct but that's about it.