Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best node.js module for finding location? [closed]

I had found couple of node.js modules for finding the information about client location and network using ip address.

Requirements:

  1. Location - country, city, state, latitude, longitude etc.

  2. Network - Internet service Provider, Internet connection type and internet speed etc.

  3. Data Accuracy - maximum possibility.

Note: Looking for server side solution.

The above mentioned modules uses maxmind data. And i had read about the maxmind data accuracy as well.

I am little confused to choose the above node.js modules and i like to know is there any better node.js frameworks available for finding information which met my requirement or any other language plugins which can be portable to node.js.

Any idea will be greatful.

like image 920
karthick Avatar asked May 21 '13 07:05

karthick


People also ask

How node is modules are availble externally?

Third-party modules: Third-party modules are the external Node modules. These are the third-party Node modules developed by Node developers that are made available through the Node ecosystem. But we need a package manager that maintains all the modules so that they can be accessed with ease.


2 Answers

Using IP-based geolocation is possible, but not very accurate. So I suggest you to think about going with a hybrid approach, like trying to get the users location via the HTML5 geolocation API inside the browser and fallback to the serverside if necessary.

I took a look at the two most used geoip/-location modules available for node.js and they both use the datasets provided by MaxMind. AFAIK you have to keep these databases up-2-date manually, which is a clear downer. So you may consider writing a little sync service / script, which updates the database once per month. (More information on MaxMinds free solution can be found here).

kuno/GeoIP is a GeoIP binding, so at it's core it's using the libGeoIP C library, which is okay, but maybe not as portable as the pure JavaScript implementation bluesmoon/node-geoip offers. Both are okay and it's up to you which library you like more. In terms of performance you have to do some benchmakrs (if this topic matters to you) … There is no general answer to the question, which type of module (C-binding/native) will be faster.

If you're willing to spend a few bucks you could also look into MaxMinds Web Service, which is a simple REST API and will be the most precise way to go. The documentation is quite good – so getting started with that won't be a problem.

like image 163
dom Avatar answered Oct 04 '22 18:10

dom


If you get the IP, you can always call an external service to get the location information such as freegeoip.net and using the request module.

(ip, location) ->   url = 'http://freegeoip.net/json/' + ip   request.get url, (error, response, body) ->     if !error && response.statusCode == 200       data = JSON.parse body       location data 

For the network infos, I don't have a solution, but I'm looking for one too.

like image 25
brnrd Avatar answered Oct 04 '22 18:10

brnrd