X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FSpikedHumorGrabber.pm;h=880263f75cd994af2a07bed142cbc6c4560280ce;hb=0c810b0d720f842f4a75872f3611e8a2ad7fa119;hp=7e763cadec3a7d6d9c145be39c0d0b7b502e6f64;hpb=911eeb36e674f916d08b04cd9c48bb33e96bf108;p=videosite.git diff --git a/videosite/SpikedHumorGrabber.pm b/videosite/SpikedHumorGrabber.pm index 7e763ca..880263f 100644 --- a/videosite/SpikedHumorGrabber.pm +++ b/videosite/SpikedHumorGrabber.pm @@ -8,7 +8,6 @@ package videosite::SpikedHumorGrabber; use videosite::GrabberBase; @ISA = qw(videosite::GrabberBase); -use LWP::Simple qw(!get); use XML::Simple; use Data::Dumper; @@ -16,15 +15,13 @@ use strict; sub new { my $class = shift; - my $self = $class->SUPER::new(); + my $self = $class->SUPER::new( + NAME => 'spikedhumor', + PATTERNS => ['(http://(?:[-a-zA-Z0-9_.]+\.)*spikedhumor.com/articles/(\d+)(?:/.*)*)'], + @_, + ); - $self->{'NAME'} = 'spikedhumor'; - $self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*spikedhumor.com/articles/(\d+)(?:/.*)*)']; - - bless($self, $class); - $self->_prepare_parameters(); - - return $self; + return bless($self, $class); } sub _parse { @@ -47,7 +44,7 @@ sub _parse { $metadata->{'DLURL'} = undef; # Get the XML file containing the video metadata - unless(defined($content = LWP::Simple::get(sprintf('http://www.spikedhumor.com/playxml/%s/data.xml', $2)))) { + unless(defined($content = $self->simple_get(sprintf('http://www.spikedhumor.com/playxml/%s/data.xml', $2)))) { $self->error('Could not download XML metadata'); return undef; }