From: Ralf Ertzinger Date: Sat, 11 Feb 2012 14:37:41 +0000 (+0100) Subject: Base: Add simple_get() function X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=commitdiff_plain;h=bde8149e4eac9d8c194adf1daa99ca8ccddb6d82 Base: Add simple_get() function --- diff --git a/videosite/Base.pm b/videosite/Base.pm index 001ec56..b31fcb6 100644 --- a/videosite/Base.pm +++ b/videosite/Base.pm @@ -220,6 +220,17 @@ sub ua { return $ua; } +sub simple_get { + my $self = shift; + my $url = shift; + my $ua = shift || $self->ua(); + my $r; + + $r = $ua->get($url); + return $r->decoded_content() if $r->is_success(); + return undef; +} + sub decode_hexurl { my $self = shift; my $d = shift;