From bde8149e4eac9d8c194adf1daa99ca8ccddb6d82 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Sat, 11 Feb 2012 15:37:41 +0100 Subject: [PATCH] Base: Add simple_get() function --- videosite/Base.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 1.8.3.1