]> git.donarmstrong.com Git - infobot.git/blob - patches/WWW::Search.patch
Initial revision
[infobot.git] / patches / WWW::Search.patch
1 --- WWW/Search/Google.pm.orig   Wed May 24 16:55:47 2000
2 +++ WWW/Search/Google.pm        Wed May 24 16:56:19 2000
3 @@ -240,7 +240,7 @@
4    if ($state eq $HITS) {
5        print "\n**state == HITS**\n" if 2 <= $self->{_debug};
6    }
7 -  if ($state eq $HITS && m@^<p><a href=([^<]+)>(.*)</a>$@i)      
8 +  if ($state eq $HITS && m@^<p><a href=([^<]+)>(.*)</a>@i)
9        {
10        print "**Found HIT**\n" if 2 <= $self->{_debug};
11        my ($url, $title) = ($1,$2);
12 @@ -252,6 +252,7 @@
13        # some queries *can* create internal junk in the url link
14        # remove them! 
15        $url =~ s/\/url\?sa=U&start=\d+&q=//g;
16 +      $url =~ s/\&exp\=OneBoxNews\s//g;                # new junk.
17        $hits_found++;
18        $hit->add_url($url);
19        $hit->title($title);
20 @@ -275,9 +276,8 @@
21        print "**Found Second Description**\n" if 2 <= $self->{_debug};
22        $sDesc = $1; 
23        $sDesc ||= '';
24 -      $sDesc =~ s/<.*?>//g; 
25 -      $sDesc = $mDesc . $sDesc;
26 -      $hit->description($sDesc);
27 +      $sDesc = $mDesc . $sDesc if (defined $mDesc);
28 +      $hit->description($sDesc) if (defined $hit and $sDesc ne '');
29        $sDesc ='';
30        $state = $HITS;
31        }