Contents

geolocate - locate IP addresses geographically

This module provides a geolocation interface for hosts and ip adresses. It will try to locate a host or ip address by querying api.hostip.info. The last results are cached for an hour.

Provided functions

(geoloc? loc:any?) --> boolean?

Returns #t, if loc is of type geoloc; #f otherwise.

(geoloc-ok? loc:geoloc?) --> boolean?

Returns #t, if all fields in loc have a value; #f otherwise.

(geoloc-country loc:geoloc?) --> symbol?

Returns the country abreviation of the location of the ip address, or #f if not available

(geoloc-ip loc:geoloc?) --> string?

Returns the ip address of the location.

(geoloc-lat loc:geoloc?) --> number?

Returns the latitude cordinate of the location, or #f if not available.

(geoloc-long loc:geoloc?) --> number?

Returns the longitude cordinate of the location, or #f if not available.

(geoloc-city loc:geoloc?) --> string?

Returns the city =of the location, or #f if not available.

(geoloc ip-or-host:string?) --> geoloc?

Returns #f, if either ip-or-host could not be resolved, or the api.hostip.info cannot be reached.

Returns a result of type geoloc, when the ip-or-host could be resolved and queried to api.hostip.info