Get information about an IP address such as country, ISP, and timezone. First have a look at the following example and then continue to read how it works.
Example
Module dbip promises a Javascript object.
var dbip =
Output
Variable info looks like this:
How does it work?
Module dbip sends a HTTP request to https://db-ip.com using module request (simplified http request client) and then uses Cheerio (server side jQuery implementation) to find the DOM elements we need.
Disclaimer
As a developer you understand that IP geolocation lookups like this are not always accurate. Because the info object is extracted from a page DOM, the module may no longer work if the website changes its page structure. If that happens, send me an email and I will fix it. (jochemstoel(@)gmail.com)
Jochem Stoel
Involuntary public figure.
- https://www.npmjs.com/~jochemstoel
- http://jochemstoel.github.io/
- https://jochemstoel.tumblr.com/
- https://jochemstoel.nl/
- https://www.facebook.com/Jochem-Stoel-271292656217087/