Commits

Shlomi Fish  committed a55562d

Release 0.0104:

- Fixed https://rt.cpan.org/Ticket/Display.html?id=21568 -
search.msn.com changed their markup.
- Thanks to PURDY for reporting it!

  • Participants
  • Parent commits bc27a64
  • Tags releases/WWW-Search-MSN/0.01/0.0104

Comments (0)

Files changed (3)

File modules/WWW-Search-MSN/Changes

 Revision history for WWW-Search-MSN
 
+0.0104  Sat Nov 11 10:10:12 IST 2006
+        - Fixed https://rt.cpan.org/Ticket/Display.html?id=21568 -
+        search.msn.com changed their markup.
+            - Thanks to PURDY for reporting it!
+
+0.0103  Fri Jul 28 12:08:08 IDT 2006
+        - Added 02empty.t to test for an empty result set.
+        - Fixed bug http://rt.cpan.org/Ticket/Display.html?id=20649
+            - Thanks to Tomasz Chomiuk for reporting it.
+
 0.0102  Wed Jul 12 21:04:58 IDT 2006
         - In 01basic.t the test now matches http:// and https:// instead of 
         just http://

File modules/WWW-Search-MSN/MANIFEST

 README
 t/00-load.t
 t/01basic.t
+t/02empty.t
 t/pod-coverage.t
 t/pod.t
 Makefile.PL

File modules/WWW-Search-MSN/lib/WWW/Search/MSN.pm

 
 =cut
 
-our $VERSION = '0.0102';
+our $VERSION = '0.0104';
 
 use vars qw(@ISA);
 
     {
         $self->{'_MSN_first_retrieve_call'} = undef;
         
-        my $header_div = $tree->look_down("_tag", "div", "id", "header");
+        my $header_div = $tree->look_down("_tag", "div", "id", "search_header");
 
+        if (!defined($header_div))
+        {
+            return 0;
+        }
         my $h5 = $header_div->look_down("_tag", "h5");
 
         if ($h5->as_text() =~ m{^\s*Page\s*\d+\s*of\s*([\d,]+)\s*results})
     # Get the next URL
     {
         my $pagination_div = $tree->look_down("_tag", "div", "id", "pagination_bottom");
-        my @li_tags = $pagination_div->look_down("_tag", "li");
-        foreach my $li (@li_tags)
+        my ($li) = $pagination_div->look_down("_tag", "li", "class", "nextPage");
+        if ($li)
         {
             my ($a_tag) = (grep { Scalar::Util::blessed($_) && ($_->tag() eq "a") } $li->content_list());
-            if (!$a_tag)
-            {
-                next;
-            }
-            if ($a_tag->as_text() eq "Next")
+            if ($a_tag)
             {
                 $self->{'_next_url'} =
                     $self->absurl(
                         $self->{'_prev_url'},
                         $a_tag->attr('href')
                     );
-                last;
             }
         }
     }