X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=quotesite.git;a=blobdiff_plain;f=quotesite%2FQdbGrabber.pm;h=411be0122f0e63d278dd93dedd6a5a2f677463e4;hp=0a652556ff38a71b7b00e17825d4cdad363b5560;hb=44e34ceffa936686dffaf174278caeed4a627562;hpb=c6a78a196987fd7a0200cc9c3d9b79bd84152a5b diff --git a/quotesite/QdbGrabber.pm b/quotesite/QdbGrabber.pm index 0a65255..411be01 100644 --- a/quotesite/QdbGrabber.pm +++ b/quotesite/QdbGrabber.pm @@ -3,14 +3,15 @@ # # Grabber for qdb.us -package QdbGrabber; +package quotesite::QdbGrabber; -use GrabberBase; -@ISA = qw(GrabberBase); +use quotesite::GrabberBase; +@ISA = qw(quotesite::GrabberBase); use LWP::Simple qw(!get); use HTML::TokeParser; use Data::Dumper; +use Encode; use strict; @@ -54,12 +55,10 @@ sub _parse { $p = HTML::TokeParser->new(\$content); - OUTER: while ($t = $p->get_tag('table')) { - if (exists($t->[1]->{'class'}) && ($t->[1]->{'class'} eq 'quote')) { - while ($t2 = $p->get_tag('p')) { - $metadata->{'CONTENT'} = $p->get_text('/p'); - last OUTER; - } + OUTER: while ($t = $p->get_tag('span')) { + if (exists($t->[1]->{'class'}) && ($t->[1]->{'class'} eq 'qt')) { + $metadata->{'CONTENT'} = encode('utf8', decode('iso8859-1', $p->get_text('/span'))); + last OUTER; } }