NAME

POE::Component::IRC::Plugin::ImageMirror - A PoCo-IRC plugin which uploads select images to a mirror service

SYNOPSIS

use POE::Component::IRC::Plugin::ImageMirror;

# mirror all images from 4chan.org
$irc->plugin_add(ImageMirror => POE::Component::IRC::Plugin::ImageMirror->new(
    URI_match => [
        qr{4chan\.org/\w+/src/.*(?i:jpe?g|gif|png)$},
    ],
));

DESCRIPTION

POE::Component::IRC::Plugin::ImageMirror is a POE::Component::IRC plugin. It looks for image URLs in the channel log and uploads the images to Imageshack, then prints a short description of the image along with the new URL.

METHODS

new

Takes the following optional arguments:

'URI_match', an array reference of regex objects. Any url found must match at least one of these regexes if it is to be uploaded. If you don't supply this parameter, a default regex of qr/(?i:jpe?g|gif|png)$/ is used.

'URI_subst', an array of regex/string pairs. These substitutions will be done on the accepted URIs before they are processed further.

Example:

# always fetch 7chan images via http, not https
URI_subst => [
    qr{(?<=^)https(?=://(?:www\.)?7chan\.org)} => 'http',
]

'Method', how you want messages to be delivered. Valid options are 'notice' (the default) and 'privmsg'.

Returns a plugin object suitable for feeding to POE::Component::IRC's plugin_add method.

AUTHOR

Hinrik Örn Sigurðsson, hinrik.sig@gmail.com

Imageshack-related code provided by Ævar Arnfjörð Bjarmason <avar@cpan.org>.