package IIa66da94aed9b371a0ee16b72f938ea09::tag_http; use strict; use base qw/II720d6e18aa34327713eb014408fc9144/; sub start { my ($this, $tag, $attr, $attrseq, $origtext)= @_; my $url = $attr->{url} or $this->harakiri('url?'); $this->evaluate for $url; $url = "http://\$ENV{HTTP_HOST}$url" if $url =~ m#^/#; my $classUA = "LWP::UserAgent"; $this->addCode($_) for grep {length} split /\n/, qq! {
require $classUA;
my \$ua = $classUA\->new;
\$ua->timeout(10);
\$ua->env_proxy;
my \$response = \$ua->get("$url");
\$this->out(\$response->is_success ? \$response->content : \$response->is_error ? \$response->error_as_HTML : '');
}
!;
return; } 1; 