Skip Menu |

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

Report information
The Basics
Id: 34871
Status: resolved
Worked: 35 min
Priority: 0/
Queue: WWW-Myspace

People
Owner: GRANTG [...] cpan.org
Requestors: steven [...] pyro.eu.org
Cc:
AdminCc:

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



Subject: Login fails; login form was changed 2008-04-10, patch included
Date: Fri, 11 Apr 2008 13:22:24 +0100
To: bug-www-myspace [...] rt.cpan.org
From: Steven Chamberlain <steven [...] pyro.eu.org>
Hi, The names of the login form inputs changed (yesterday, I believe) from: ctl00$Main$SplashDisplay$ctl00$Email_Textbox to: ctl00$ctl00$Main$cpMain$SplashDisplay$ctl00$Email_Textbox and likewise, for the password textbox and login button. WWW::Myspace (at least the latest SVN, R566) is currently unable to login as a result of this change. I have attached a patch which adds support for this new form as well supporting the old ones (in case it ever changes back). I also tidied up the comments in the _try_login function. I hope this helps! Regards, -- Steven Chamberlain steven@pyro.eu.org
Index: lib/WWW/Myspace.pm =================================================================== --- lib/WWW/Myspace.pm (revision 566) +++ lib/WWW/Myspace.pm (working copy) @@ -629,29 +629,46 @@ if ( $tries_left ) { $tries_left--; return if ( $tries_left ) < 1; } $tries_left = 20 unless defined $tries_left; - # Submit the login form. They have two different ones, so if we see indication of - # the ASP form (new as of late Jun 2007), use it, otherwise use the CFM version. - # 9/17/07 - they changed from "ctl01" to "ctl00", so we check for both in case - # they go back and forth. + # Detect which login form is in use, and submit it. my $submitted=""; $self->get_page( 'http://www.myspace.com/' ); if ( $self->current_page->decoded_content =~ - /ctl00\$Main\$SplashDisplay\$ctl00\$Email_Textbox/io ) + /ctl00\$ctl00\$Main\$cpMain\$SplashDisplay\$ctl00\$Email_Textbox/io ) { + # 2008-04-11 -- they added an extra ctl00$ and cpMain$ to the names of + # the login form inputs $submitted = $self->submit_form( { # page => 'http://www.myspace.com/', form_name => 'aspnetForm', - fields_ref => { 'ctl00$Main$SplashDisplay$ctl00$Email_Textbox' => $self->account_name, - 'ctl00$Main$SplashDisplay$ctl00$Password_Textbox' => $self->password, - # '__EVENTTARGET' => 'ctl00$Main$SplashDisplay$ctl00$Login_ImageButton', + fields_ref => { 'ctl00$ctl00$Main$cpMain$SplashDisplay$ctl00$Email_Textbox' => $self->account_name, + 'ctl00$ctl00$Main$cpMain$SplashDisplay$ctl00$Password_Textbox' => $self->password, + # '__EVENTTARGET' => 'ctl00$ctl00$Main$cpMain$SplashDisplay$ctl00$Login_ImageButton', # '__EVENTARGUMENT' => '', }, action => 'http://secure.myspace.com/index.cfm?fuseaction=login.process', # no_click => 1, } ) ; } elsif ( $self->current_page->decoded_content =~ + /ctl00\$ctl00\$Main\$cpMain\$SplashDisplay\$ctl00\$Email_Textbox/io ) + { + # 2007-09-17 -- they changed from "ctl01" to "ctl00". If this form is + # not found we check for the "ctl01" form in case they go back and + # forth. + $submitted = $self->submit_form( { +# page => 'http://www.myspace.com/', + form_name => 'aspnetForm', + fields_ref => { 'ctl00$Main$SplashDisplay$ctl00$Email_Textbox' => $self->account_name, + 'ctl00$Main$SplashDisplay$ctl00$Password_Textbox' => $self->password + # '__EVENTTARGET' => 'ctl00$ctl00$Main$cpMain$SplashDisplay$ctl00$Login_ImageButton', + # '__EVENTARGUMENT' => '',, + }, + action => 'http://secure.myspace.com/index.cfm?fuseaction=login.process', + # no_click => 1, + } ) ; + } elsif ( $self->current_page->decoded_content =~ /ctl00\$Main\$SplashDisplay\$ctl01\$Email_Textbox/io ) { + # Late 2007-06 -- an ASP form appears alongside the CFM form $submitted = $self->submit_form( { # page => 'http://www.myspace.com/', form_name => 'aspnetForm', @@ -664,6 +681,7 @@ # no_click => 1, } ) } else { + # The old CFM form my $btn_name = $self->current_page->decoded_content =~ /ctl00\$Main\$SplashDisplay\$ctl00\$loginbutton/ ? 'ctl00$Main$SplashDisplay$ctl00$loginbutton' :
Patch applied, new version 0.76 uploading to CPAN now (4/11/08 1:37pm PST).
Subject: Re: [rt.cpan.org #34871] Resolved: Login fails; login form was changed 2008-04-10, patch included
Date: Fri, 11 Apr 2008 23:26:15 +0100
To: bug-WWW-Myspace [...] rt.cpan.org
From: Steven Chamberlain <steven [...] pyro.eu.org>
Hi, I can see that my patch is mentioned in the v0.76 changelog, but as far as I can tell the Myspace.pm module wasn't modified at all? Did you forget to actually apply the patch before releasing? Regards, -- Steven Chamberlain steven@pyro.eu.org
Oops. Good catch, thanks. I was having trouble with SVN and had to re-check-out the module and re-apply the changes. Evidently I pulled the patch back down but forgot to actually run "patch" on it... D'oh. 0.77 has patch applied and is uploading now. Grant