X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FCollegeHumorGrabber.pm;h=c7851e37ff87ed7eb735a452dcb05249c67e7aa8;hb=13d23a6f19e2f8192d894171aaecc7987044a72a;hp=fb032863b323fb506a9e7a8163a1cc2686ed0b97;hpb=bb930ff32f3b4bb4081037550760e4f82af4c39f;p=videosite.git diff --git a/videosite/CollegeHumorGrabber.pm b/videosite/CollegeHumorGrabber.pm index fb03286..c7851e3 100644 --- a/videosite/CollegeHumorGrabber.pm +++ b/videosite/CollegeHumorGrabber.pm @@ -9,7 +9,6 @@ use videosite::GrabberBase; @ISA = qw(videosite::GrabberBase); use videosite::HTMLHelper; -use LWP::Simple qw(!get); use XML::Simple; use Data::Dumper; @@ -17,16 +16,16 @@ use strict; sub new { my $class = shift; - my $self = $class->SUPER::new(); - - $self->{'NAME'} = 'collegehumor'; - $self->{'PATTERNS'} = ['(http://www.collegehumor.com/video:(\d+))', - '(http://www.collegehumor.com/video/(\d+))']; - - bless($self, $class); - $self->_prepare_parameters(); - - return $self; + my $self = $class->SUPER::new( + NAME => 'collegehumor', + _SELFTESTURL => 'http://www.collegehumor.com/video/5635400/pixar-intro-parody', + _SELFTESTTITLE => 'Pixar Intro Parody', + PATTERNS => ['(http://www.collegehumor.com/video:(\d+))', + '(http://www.collegehumor.com/video/(\d+))'], + @_, + ); + + return bless($self, $class); } sub _parse { @@ -50,7 +49,7 @@ sub _parse { $metadata->{'DLURL'} = undef; # Get the XML file containing the video metadata - unless(defined($content = LWP::Simple::get(sprintf('http://www.collegehumor.com/moogaloop/video/%s', $2)))) { + unless(defined($content = $self->simple_get(sprintf('http://www.collegehumor.com/moogaloop/video/%s', $2)))) { $self->error('Could not download XML metadata'); return undef; }