Hacker News new | ask | show | jobs
by coderholic 3409 days ago
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.