The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Plagger::Plugin::Filter::GuessTimeZoneByDomain - Guess timezone by domains if datetime is floating or UTC

SYNOPSIS

  - module: Filter::GuessTimeZoneByDomain

DESCRIPTION

This plugin guesses feed date timezone by domains, if dates are floating or UTC. It uses the mapping table from ISO 3166 country code to timezones available in Olson database (hence requires DateTime::TimeZone 0.51).

Optionally, if you have IP::Country module installed. This plugin also checks the country name which the host address is assigned to, instead of its domain name (ccTLD).

For example, if the datetime is floating or UTC set in the feed of example.jp, it is resolved to Asia/Tokyo since its ccTLD is jp. In the case of www.asahi.com, ccTLD is null but the IP address is assigned to Japan, hence it is resolved to Asia/Tokyo as well.

CONFIG

conflict_policy
  conflict_policy: cc
  conflict_policy: ip

conflict_policy determines what to do if timezones guessed from 1) ccTLD and 2) country code from IP::Country doesn't match. cc prioritizes ccTLD, and ip prioritizes IP::Country.

For example, http://www.sixapart.jp/ has a ccTLD jp, but its host address is assigned to the United States (US). In this case:

  conflict_policy    timezone
  -----------------------------------
  cc                 Asia/Tokyo
  ip                 America/New_York

(Note that US has multiple timezones but America/New_York is used since this one is listed first in the Olson database.)

Defaults to cc.

AUTHOR

Tatsuhiko Miyagawa

SEE ALSO

Plagger, Plagger::Plugin::Filter::FloatingDateTime, DateTime::TimeZone