use strict; use warnings; package GetURL; use base 'PluginBase'; sub new { my ($class, %params) = @_; return $class->SUPER::new (%params); } sub doit { my $self = shift; my $module = 'LWP::Simple'; return "Couldnt retrieve url" unless $module->use; my $w_data = $self->get_arg ('url'); return "Couldnt find channel tag" unless $self->get_raw_data () =~ m@(.*?)@s; my $channel_data = $self->quote_special ($1); my $result = ''; while ($channel_data =~ m@(.*?)@s) { my $item_info = $1; my $mask = $self->get_data (); #the output mask is set to a copy of the data #handed to the plugin while ($mask =~ m@(.*?)@s) { my $get_item = $1; my $item_string; $item_string = $1 if $item_info =~ m@<$get_item>(.*?)@s; $mask =~ s@$get_item@$item_string@; } $result .= $mask; $channel_data =~ s@$item_info@@; } return $result; }