MrForsythExeter has asked for the wisdom of the Perl Monks concerning the following question:
#Pull the page and sort it out.. then display edit window use LWP::UserAgent; my $ua = LWP::UserAgent->new(); $ua->agent(""); my $content = $ua->get($fields{'url'})->content(); $fields{'url'} =~ s/http:\/\/(.*?)\/.*/$1/ig; $content =~ s/src="/src="http:\/\/$fields{'url'}\//sig; #Handle Styles $content =~ m/<link href="(.*?)"/ig; my $styleurl = $1; my $styles; if ($styleurl ne ''){ $styles = $ua->get($fields{'url'}.'/'.$styleurl)->con +tent(); } $styles = '<style type="text/css"><!--'.$styles.'--></styl +e>'; $content =~ s/<\/head>/<\/head>$styles/sig; $tpl_inner = &gettpl($skindir,'pointblank_templateadd2.htm +'); $tpl_inner =~ s/<!-- Content -->/$content/ig;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pulling a Page with LWP::UserAgent and fixing URLs?
by Mutant (Priest) on Nov 09, 2004 at 11:53 UTC | |
by MrForsythExeter (Novice) on Nov 09, 2004 at 12:03 UTC | |
by Mutant (Priest) on Nov 09, 2004 at 12:09 UTC | |
by teabag (Pilgrim) on Nov 09, 2004 at 12:11 UTC | |
by MrForsythExeter (Novice) on Nov 09, 2004 at 15:08 UTC | |
by teabag (Pilgrim) on Nov 10, 2004 at 14:30 UTC | |
by b10m (Vicar) on Nov 09, 2004 at 19:07 UTC | |
|
Re: Pulling a Page with LWP::UserAgent and fixing URLs?
by Popcorn Dave (Abbot) on Nov 09, 2004 at 21:16 UTC |