linkcheck.plugins.locationinfo

Store and retrieve country names for IPs.

Functions

get_geoip_dat()

Find a GeoIP database, preferring city over country lookup.

get_location(*args, **kwargs)

Get translated country and optional city name.

Classes

LocationInfo(config)

Adds the country and if possible city name of the URL host as info.

class linkcheck.plugins.locationinfo.LocationInfo(config)[source]

Bases: _ConnectionPlugin

Adds the country and if possible city name of the URL host as info. Needs GeoIP or pygeoip and a local country or city lookup DB installed.

Check for geoip module.

applies_to(url_data)[source]

Check for validity, host existence and geoip module.

check(url_data)[source]

Try to ask GeoIP database for country info.

linkcheck.plugins.locationinfo.get_geoip_dat()[source]

Find a GeoIP database, preferring city over country lookup.

linkcheck.plugins.locationinfo.get_location(*args, **kwargs)[source]

Get translated country and optional city name.

Returns:

country with optional city or an boolean False if not found