X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite%2FSpikedHumorGrabber.pm;h=880263f75cd994af2a07bed142cbc6c4560280ce;hb=a96de45e14a9779163091452496ac91b4c3079ea;hp=9925a3030664647bd9c3811403873173f55ad767;hpb=06718ca32510df74bbefe4e6428aa0d857ecb0ec;p=videosite.git diff --git a/videosite/SpikedHumorGrabber.pm b/videosite/SpikedHumorGrabber.pm index 9925a30..880263f 100644 --- a/videosite/SpikedHumorGrabber.pm +++ b/videosite/SpikedHumorGrabber.pm @@ -3,12 +3,11 @@ # # Grabber for spikedhumor.com -package SpikedHumorGrabber; +package videosite::SpikedHumorGrabber; -use GrabberBase; -@ISA = qw(GrabberBase); +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; }