Skip Menu |

This queue is for tickets about the WWW-Myspace CPAN distribution.

Report information
The Basics
Id: 35702
Status: resolved
Priority: 0/
Queue: WWW-Myspace

People
Owner: Nobody in particular
Requestors: steven [...] pyro.eu.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: get_friends repeatedly clicks 'Next' button; patch included
Date: Wed, 07 May 2008 23:33:05 +0100
To: bug-www-myspace [...] rt.cpan.org
From: Steven Chamberlain <steven [...] pyro.eu.org>
Hi, The regex for detecting a 'Next' button no longer works properly with the new friends lists. This led to get_friends repeatedly trying to view many additional pages beyond the last one. My attached patch seems to fix that, and has been tested with a full 'make test' (including all 'logged in' tests). The comments added in the patch explain exactly what the problem was. Regards, -- Steven Chamberlain steven@pyro.eu.org
Index: lib/WWW/Myspace.pm =================================================================== --- lib/WWW/Myspace.pm (revision 578) +++ lib/WWW/Myspace.pm (working copy) @@ -6496,8 +6501,18 @@ $content = $self->current_page->decoded_content; } - $content =~ /">\s*Next\s*((<\/a>)?((\s|&nbsp;)+(\&gt;|>))?|&rsaquo;\s*<\/a>)/io; + # Example HTML for 'Next' button in messaging inbox: + # <a class="pagingLink" href="javascript:__doPostBack('ctl00$ctl00$Main$messagingMain$MessageList$pagingTop','2')">Next &rsaquo;</a> + # + # Example HTML for 'Next' button in friends list: + # <a href="javascript: GotoPage(6);" class="nextPagingLink">next</a> + # + # Example HTML for a *disabled* 'Next' button in friends list -- we do not + # want to match this: + # <a class="nextPagingLink disabledPaging">next</a> + $content =~ /<a [^>]*href=\"[^\"]*\"[^>]*>(\s|&nbsp;)*Next(\s|&nbsp;|&rsaquo;|&gt;)*<\/a>/io; + } =head2 _previous_button
On Wed May 07 18:33:25 2008, steven@pyro.eu.org wrote: Show quoted text
> Hi, > > The regex for detecting a 'Next' button no longer works properly with > the new friends lists. This led to get_friends repeatedly trying to > view many additional pages beyond the last one. > > My attached patch seems to fix that, and has been tested with a full > 'make test' (including all 'logged in' tests). The comments added in > the patch explain exactly what the problem was. > > Regards,
Hi Steven, Thanks for very much for this patch as well. It has also been applied to the module and will be available in the next release. All the best, Olaf