git://git.camperquake.de
/
videosite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert to use of a json style config file
[videosite.git]
/
videosite
/
WimpGrabber.pm
diff --git
a/videosite/WimpGrabber.pm
b/videosite/WimpGrabber.pm
index
c424760
..
e9b14ff
100644
(file)
--- a/
videosite/WimpGrabber.pm
+++ b/
videosite/WimpGrabber.pm
@@
-8,7
+8,6
@@
package videosite::WimpGrabber;
use videosite::GrabberBase;
@ISA = qw(videosite::GrabberBase);
use videosite::GrabberBase;
@ISA = qw(videosite::GrabberBase);
-use LWP::Simple qw(!get);
use MIME::Base64;
use HTML::Parser;
use Data::Dumper;
use MIME::Base64;
use HTML::Parser;
use Data::Dumper;
@@
-20,6
+19,8
@@
sub new {
my $self = $class->SUPER::new();
$self->{'NAME'} = 'wimp';
my $self = $class->SUPER::new();
$self->{'NAME'} = 'wimp';
+ $self->{_SELFTESTURL} = 'http://www.wimp.com/insanebuilding/';
+ $self->{_SELFTESTTITLE} = 'Insane building.';
$self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*wimp.com/([^/]+)/?)'];
bless($self, $class);
$self->{'PATTERNS'} = ['(http://(?:[-a-zA-Z0-9_.]+\.)*wimp.com/([^/]+)/?)'];
bless($self, $class);
@@
-50,7
+51,7
@@
sub _parse {
$metadata->{'TITLE'} = undef;
$metadata->{'DLURL'} = undef;
$metadata->{'TITLE'} = undef;
$metadata->{'DLURL'} = undef;
- unless(defined($content =
LWP::Simple::
get(sprintf('http://www.wimp.com/%s', $2)))) {
+ unless(defined($content =
$self->simple_
get(sprintf('http://www.wimp.com/%s', $2)))) {
$self->error('Could not download %s', $url);
return undef;
}
$self->error('Could not download %s', $url);
return undef;
}
@@
-63,7
+64,7
@@
sub _parse {
# Look for the title in the meta tags
foreach $e (@accum) {
# Look for the title in the meta tags
foreach $e (@accum) {
- if ('meta' eq $e->[0]) {
+ if ('meta' eq $e->[0]
and exists($e->[1]->{'name'})
) {
if ('description' eq $e->[1]->{'name'}) {
$metadata->{'TITLE'} = $e->[1]->{'content'};
last;
if ('description' eq $e->[1]->{'name'}) {
$metadata->{'TITLE'} = $e->[1]->{'content'};
last;