Earlier quoted context omitted.
Calling 'print' from within a library is pretty bad form too... responses and errors should always be returned as data that can be inspected programmatically. In this case it's even worse, as the code will just return None on error, and you don't know why.
^ This. Never call print from a library, what if I'm using a script to pipe stdout somewhere. Just throw a custom GeolocationException or something, with some useful data about what went wrong. In this specific case though, just don't bother catching the exception. It's not useful and it indicates something is terribly wrong.
Show HN: A New, Clean Geolocation API
131–140 of 168 posts
Re: Show HN: A New, Clean Geolocation API
#132Are you able to flag an IP address as an IP coming from a VPN?
Disclaimer: I'm the founder of Shodan and identifying the type of connection is something we're often used for.
Re: Show HN: A New, Clean Geolocation API
#133Earlier quoted context omitted.
It's more than that, for some countries.
Usually right because people from these countries are trying to evade location-based discrimination and privacy infringement
Indonesia -- 47%
Thailand -- 39%
Brazil -- 36%
Turkey -- 36%
UAE -- 36%
Viet Nam -- 35%
Saudi Arabia -- 34%
India -- 32%
Malaysia -- 32%
...
UK -- 14%
US -- 14%
https://wi-images.condecdn.net/image/3K6WrWwGrKN/crop/810Re: Show HN: A New, Clean Geolocation API
#134> Get the following datapoints from any IP address; Again :-( I just wonder if people will ever stop making assumptions about others given their IP address or hair colours and divide the Internet on these slippery grounds. The only legitimate and valid way to determine the client's location automatically is the browser or the OS geolocation API, and for the language it is the HTTP_ACCEPT_LANGUAGE header. The fact I h…
This comment reminds me of the couple of people on HN that complain everytime someone shows off a new product and it doesn't work well in their text only lynx browser. It's such an extreme edge case that it doesn't really matter. (unless you are of course targeting that type of market). In other words, IP address gives a general location in a huge number of cases.
Re: Show HN: A New, Clean Geolocation API
#135Earlier quoted context omitted.
This comment reminds me of the couple of people on HN that complain everytime someone shows off a new product and it doesn't work well in their text only lynx browser. It's such an extreme edge case that it doesn't really matter. (unless you are of course targeting that type of market). In other words, IP address gives a general location in a huge number of cases.
It's fine as long as you're willing to accept that it's going to be wrong an unknown amount of the time.
Re: Show HN: A New, Clean Geolocation API
#136> Get the following datapoints from any IP address; Again :-( I just wonder if people will ever stop making assumptions about others given their IP address or hair colours and divide the Internet on these slippery grounds. The only legitimate and valid way to determine the client's location automatically is the browser or the OS geolocation API, and for the language it is the HTTP_ACCEPT_LANGUAGE header. The fact I h…
Believe it or not, you make up about 0.000001%[1] of the internet users. There is no saying in what this can be applied, it doesn't have to be for language or anything like that. It doesn't even have to be anything customer facing, and if it's just some stats you will probably probably just be a bit of noise. Don't get me wrong. I totally agree that this thing is definitely not accurate(it thinks i'm 1300mi away) but…
Re: Show HN: A New, Clean Geolocation API
#137Earlier quoted context omitted.
Just cache the responses so that only the first time a new IP connects it needs to be looked up (until cache fills) Integrating maxmind is a bit of a pain and it’s a massive database. Not well suited to use cases like single purpose or ephemeral containers. You’ll probably end up storing the maxmind db in a separate node on your local network, anyway. So you still have a latency issue (although lower, obviously). Mor…
It's a 100mb db. You load it in-memory (mmap) on every webserver.
Re: Show HN: A New, Clean Geolocation API
#138> Get the following datapoints from any IP address; Again :-( I just wonder if people will ever stop making assumptions about others given their IP address or hair colours and divide the Internet on these slippery grounds. The only legitimate and valid way to determine the client's location automatically is the browser or the OS geolocation API, and for the language it is the HTTP_ACCEPT_LANGUAGE header. The fact I h…
Re: Show HN: A New, Clean Geolocation API
#139Earlier quoted context omitted.
It's a 100mb db. You load it in-memory (mmap) on every webserver.
I consider 100mb to be quite large. That could easily double memory consumption of an application. Most http services are light but widely replicated. Adding 100mb of memory usage to each replica is certainly a tradeoff.