GunghoX::FollowLinks::Rule::Fresh - Only Follow Fresh Links


GunghoX-FollowLinks documentation  | view source Contained in the GunghoX-FollowLinks distribution.

Index


NAME

Top

GunghoX::FollowLinks::Rule::Fresh - Only Follow Fresh Links

SYNOPSIS

Top

  use GunghoX::FollowLinks::Rule::Fresh;
  my $rule = GunghoX::FollowLinks::Rule::Fresh->new(
    storage => {
      module => "Memory",
    }
  );
  $rule->apply( $c, $response, $url, $attrs );

DESCRIPTION

Top

This rule allows you to follow links thatyou haven't seen yet. The list of URLs that have been fetched are stored in a storage module of your choise.

If you want to put it in a memcached instance, for example, you can specify it like this:

  my $rule = GunghoX::FollowLinks::Rule::Fresh->new(
    storage => {
      module => "Cache",
      config => {
        cache => {
          module => "Cache::Memcached",
          config => {
            servers => "127.0.0.1:11211",
            compress_threshold => 10_000,
          }
        }
      }
    }
  );

METHODS

Top

new

Creates a new rule instance. You must specify the storage backend.

apply

Applies the rule.


GunghoX-FollowLinks documentation  | view source Contained in the GunghoX-FollowLinks distribution.