r27132 - in /trunk/libwww-myspace-perl: Changes META.yml debian/changelog lib/WWW/Myspace.pm t/login-forms/latest.html

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sat Nov 22 16:36:10 UTC 2008


Author: gregoa
Date: Sat Nov 22 16:36:07 2008
New Revision: 27132

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27132
Log:
New upstream release.

Modified:
    trunk/libwww-myspace-perl/Changes
    trunk/libwww-myspace-perl/META.yml
    trunk/libwww-myspace-perl/debian/changelog
    trunk/libwww-myspace-perl/lib/WWW/Myspace.pm
    trunk/libwww-myspace-perl/t/login-forms/latest.html

Modified: trunk/libwww-myspace-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-myspace-perl/Changes?rev=27132&op=diff
==============================================================================
--- trunk/libwww-myspace-perl/Changes (original)
+++ trunk/libwww-myspace-perl/Changes Sat Nov 22 16:36:07 2008
@@ -1,4 +1,26 @@
 Revision history for WWW::Myspace
+
+0.91    2008-11-20
+        - Fixed approve_friend_requests which was no longer working as a result
+          of Myspace changes (RT#41074, patch from David Moreno Garza)
+        - Example script samples/approve_friends also fixed by the above change
+
+0.90    2008-11-15
+        - Fixed a new problem in get_inbox and read_message, which were no
+          longer returning the message sender's name or ID due to Myspace
+          changes probably made on 2008-11-15
+
+0.89    2008-11-14
+        - This release replaces a dud re-release of 0.88 made earlier today
+          which had some of the following enhancements but the version
+          number had not been increased
+        - Fixed a problem with get_inbox whereby no messages were returned
+          unless the inbox held more than one page of messages (more than 10
+          messages)
+        - Fixed post_comment, broken by recent Myspace changes
+        - Altered CAPTCHA handling in post_comment such that the configured
+          handler (if any) is now called repeatedly if CAPTCHA responses are
+          rejected
 
 0.88    2008-10-01
         - Fixed is_band to correctly detect music profiles, which broke due to

Modified: trunk/libwww-myspace-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-myspace-perl/META.yml?rev=27132&op=diff
==============================================================================
--- trunk/libwww-myspace-perl/META.yml (original)
+++ trunk/libwww-myspace-perl/META.yml Sat Nov 22 16:36:07 2008
@@ -1,25 +1,31 @@
 --- #YAML:1.0
-name:                WWW-Myspace
-version:             0.88
-abstract:            Access MySpace.com profile information from Perl
-license:             perl
-generated_by:        ExtUtils::MakeMaker version 6.36
-distribution_type:   module
-requires:     
-    Config::General:               0
-    Contextual::Return:            0
-    Crypt::SSLeay:                 0.53
-    File::Spec::Functions:         0
-    Locale::SubCountry:            1.38
-    Params::Validate:              0
-    Spiffy:                        0.24
-    Test::More:                    0
-    Time::ParseDate:               100.010301
-    URI::Escape:                   0
-    WWW::Mechanize:                1.2
-    YAML:                          0.39
-meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
-    version: 1.2
+name:               WWW-Myspace
+version:            0.91
+abstract:           Access MySpace.com profile information from Perl
 author:
     - Grant Grueninger <grantg at cpan.org>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+requires:
+    Config::General:      0
+    Contextual::Return:   0
+    Crypt::SSLeay:        0.53
+    File::Spec::Functions:  0
+    Locale::SubCountry:   1.38
+    Params::Validate:     0
+    Spiffy:               0.24
+    Test::More:           0
+    Time::ParseDate:      100.010301
+    URI::Escape:          0
+    WWW::Mechanize:       1.2
+    YAML:                 0.39
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.48
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libwww-myspace-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-myspace-perl/debian/changelog?rev=27132&op=diff
==============================================================================
--- trunk/libwww-myspace-perl/debian/changelog (original)
+++ trunk/libwww-myspace-perl/debian/changelog Sat Nov 22 16:36:07 2008
@@ -1,7 +1,8 @@
-libwww-myspace-perl (0.88-2) UNRELEASED; urgency=low
+libwww-myspace-perl (0.91-1) UNRELEASED; urgency=low
 
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
     (source stanza).
+  * New upstream release.
 
  -- gregor herrmann <gregoa at debian.org>  Sun, 16 Nov 2008 20:49:02 +0100
 

Modified: trunk/libwww-myspace-perl/lib/WWW/Myspace.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-myspace-perl/lib/WWW/Myspace.pm?rev=27132&op=diff
==============================================================================
--- trunk/libwww-myspace-perl/lib/WWW/Myspace.pm (original)
+++ trunk/libwww-myspace-perl/lib/WWW/Myspace.pm Sat Nov 22 16:36:07 2008
@@ -1,7 +1,7 @@
 #####################################################################
 # WWW::Myspace.pm
 # Sccsid:  %Z%  %M%  %I%  Delta: %G%
-# $Id: Myspace.pm 647 2008-10-01 04:42:20Z s-chamberlain $
+# $Id: Myspace.pm 655 2008-11-20 05:52:58Z s-chamberlain $
 ######################################################################
 # Copyright (c) 2005 Grant Grueninger, Commercial Systems Corp.
 #
@@ -43,11 +43,11 @@
 
 =head1 VERSION
 
-Version 0.88
-
-=cut
-
-our $VERSION = '0.88';
+Version 0.91
+
+=cut
+
+our $VERSION = '0.91';
 
 =head1 WARNING
 
@@ -3886,6 +3886,14 @@
     croak "Must pass friend_id and message to post_comment" unless
         ( ( $friend_id ) && ( $message ) );
 
+    if ( defined $captcha_response )
+    {
+        warn "You provided a captcha_response parameter to post_comment;\n".
+             " this is currently broken and doomed to failure.  Please\n".
+             " consider using the new CAPTCHA interface instead (see the\n".
+             " documentation for captcha_handler)\n";
+    }
+
     my %status_codes = (
 
         P   =>  'Passed! Verification string received.',
@@ -3924,14 +3932,15 @@
             unless ( $link ) { $status="FL"; last TESTBLOCK; }
 
             ( $DEBUG ) && print "Getting comment form..\n";
+            my $input_name_prefix = 'ctl00$ctl00$cpMain$UserWriteCommentsControl$';
             $submitted =
                 $self->submit_form( {
                          page => $link->url,
                          follow => 1,
                          form_name => 'aspnetForm',
                          fields_ref => {
-                            'ctl00$cpMain$UserWriteCommentsControl$commentTextBox' => "$message",
-                            'ctl00$cpMain$UserWriteCommentsControl$postcommentImageButton' => "Post A Comment",
+                            $input_name_prefix.'commentTextBox' => "$message",
+                            $input_name_prefix.'postcommentImageButton' => "Post A Comment",
     #                        '__EVENTTARGET' => 'ctl00$cpMain$UserWriteCommentsControl$postcommentImageButton',
     #                        '__EVENTARGUMENT' => '',
                          },
@@ -3942,30 +3951,61 @@
             # If we posted ok, confirm the comment
             if ( $submitted ) {
 
-                my $captcha_result="";
+                my $captcha_response = "";
+                my $captcha_attempt = 0;
                 my $fields = ();
 
-                # See if there's a CAPTCHA response required, if so,
-                # deal with it or fail appropriately.
                 if ( $self->current_page->decoded_content =~ $CAPTCHAi ) {
-                    $self->captcha( $1 );
-                    #TODO: Not tested - comment captcha may be on a separate form?
-                    $captcha_result = $self->_handle_captcha( {
-                        image_url => $1,
-                        action => 'post_comment',
+
+                    # See if there's a CAPTCHA response required, if so, deal with
+                    #  it or fail appropriately.  If another CAPTCHA is shown (eg.
+                    #  because the CAPTCHA response was wrong) then we retry
+                    #  forever (until the handler returns an empty string).
+                    while ( $self->current_page->decoded_content =~ $CAPTCHAi ) {
+
+                        # :FIXME: this relates to the *old* CAPTCHA interface;
+                        #  please remove
+                        $self->captcha( $1 );
+
+                        # Call the CAPTCHA handler (the new CAPTCHA interface)
+                        $captcha_response = $self->_handle_captcha( {
+                            image_url => $1,
+                            action => 'post_comment',
+                            attempt => $captcha_attempt,
+                        } );
+
+                        unless ( $captcha_response ) { $status='FC'; last TESTBLOCK; }
+                        $fields->{$input_name_prefix.'captcha$captchaResponseTextBox'}
+                            = $captcha_response;
+
+                        ( $DEBUG ) && print "Entering comment CAPTCHA response...\n";
+                        $submitted = $self->submit_form( {
+                            follow => 1,
+                            form_name => 'aspnetForm',
+                            button => $input_name_prefix.'ConfirmPostButton',
+                            fields_ref => $fields
+                        } );
+
+                        if ( !$submitted ) {
+                            $self->error( 'Failed to submit CAPTCHA response in post_comment:  '.
+                                $self->error );
+                        }
+
+                    }
+
+                } else {
+
+                    # If there was no CAPTCHA. just confirm the comment post.
+                    ( $DEBUG ) && print "Confirming comment...\n";
+                    $submitted = $self->submit_form( {
+                        follow => 1,
+                        form_name => 'aspnetForm',
+                        button => $input_name_prefix.'ConfirmPostButton',
+                        fields_ref => $fields
                     } );
-                    unless ( $captcha_result ) { $status='FC'; last TESTBLOCK; }
-                    $fields->{'ctl00$cpMain$UserWriteCommentsControl$captcha$captchaResponseTextBox'} = $captcha_result;
+
                 }
 
-                # Otherwise, confirm it.
-                ( $DEBUG ) && print "Confirming comment...\n";
-                $submitted = $self->submit_form( {
-                    follow => 1,
-                    form_name => 'aspnetForm',
-                    button => 'ctl00$cpMain$UserWriteCommentsControl$ConfirmPostButton',
-                    fields_ref => $fields
-                } );
             } else {
                 $self->error( 'First submit failed in post_comment with error: '.
                     $self->error );
@@ -3973,6 +4013,7 @@
 
         } else {
             # :FIXME: this is no longer used?
+            # :FIXME: if this is still used, it definitely doesn't work any more
 
             # Post the confirmation
             $submitted = $self->submit_form( '', 1, '',
@@ -4286,11 +4327,34 @@
                     ) or return;
         }
 
+
+        # Get the message data.
+        push @messages, $self->_get_messages_from_page( %options );
+
+        # Stop if we got to the specified message
+        last if ( $options{'stop_at_msg'} &&
+                  ( $options{'stop_at_msg'} == $messages[-1]->{message_id} )
+                );
+
+        # Stop if we're on the last page
+        last unless ( $self->_next_button );
+
+        # Stop if we've reached the last page they requested
+        last if ( $options{'end_page'} && ( $page_no >= $options{'end_page'} ) );
+
+        # Stop if we're only requesting one page
+        last if ( $options{'page_no'} );
+
+
+        # Onto the next page
+        $page_no++;
+
         $self->current_page->decoded_content =~
             /javascript:__doPostBack\('(.*?)'.*?>Next/ismo;
         $eventtarget = $1;
         unless ( $eventtarget ) {
-            $self->error('get_inbox couldn\'t detect EVENTTARGET in form on inbox page '.$page_no);
+            # This may happen if there is exactly one page of messages
+#            $self->error('get_inbox couldn\'t detect EVENTTARGET in form on inbox page '.$page_no);
             return;
         }
 
@@ -4305,25 +4369,6 @@
             } );
         }
 
-        # Get the message data.
-        push @messages, $self->_get_messages_from_page( %options );
-
-        # Stop if we got to the specified message
-        last if ( $options{'stop_at_msg'} &&
-                  ( $options{'stop_at_msg'} == $messages[-1]->{message_id} )
-                );
-
-        # Stop if we're on the last page
-        last unless ( $self->_next_button );
-
-        # Stop if we've reached the last page they requested
-        last if ( $options{'end_page'} && ( $page_no >= $options{'end_page'} ) );
-
-        # Stop if we're only requesting one page
-        last if ( $options{'page_no'} );
-
-        # Next!
-        $page_no++;
     }
 
     return \@messages;
@@ -4354,7 +4399,7 @@
 	if(/<td\s[^>]*class="(?:.* )?messageListCell(?: .*)?"[^>]*>/){
 		# Found beginning of Message block
 		$state = 1;
-	} elsif (/viewprofile&friendid=([0-9]+)"?>([^<>]+)</ && $state == 1){
+	} elsif (/viewprofile\&(?:amp;)?friendid=([0-9]+)"[^>]*\stitle="([^"]+)"[^>]*>/ && $state == 1){
 		$sender = $1;
                 $sendername = $2;
 	} elsif (/(Unread|Read|Sent|Replied)/ && $state == 1){
@@ -4456,7 +4501,7 @@
     $page =~ s/[ \t\n\r]+/ /go; # Turn multiple whitespace into single space
 
     # From:
-    $page =~ /From:.*?friendID=([0-9]+)"?>([^<>]+)</io;
+    $page =~ /From:.*?friendid=([0-9]+).*?"[^>]*\stitle="([^"]+)"[^>]*>/io;
     $message{'from'} = $1;
     $message{'fromname'} = $2;
 
@@ -5078,7 +5123,7 @@
     my $line = "";
 
     # Get the GUID codes from it.
-    while ( $page =~ s/ctl00\$ctl00\$Main\$Main\$incomingRequests\$requestRepeater\$ctl00\$selectRequest.*? value="(.*?)"//im ) {
+    while ( $page =~ s/(ctl00\$ctl00\$ctl00\$cpMain\$cpMain\$messagingMain\$FriendRequestsIncomingV2.+?\$messageCheckBox)//im ) {
         $guids{"$1"}++;
     }
 
@@ -5277,8 +5322,6 @@
             # Check for CAPTCHA
             #elsif ( $page =~ /CAPTCHA/o ) {
             elsif ( $page =~ $CAPTCHAi ) {
-                # :FIXME: add an option not to use CAPTCHA handler on FU profiles
-                # :FIXME: maybe add CAPTCHA preferences hash ref somewhere
 
                 my $friend_requires_captcha =
                     $self->_apply_regex( regex => 'user_requires_captcha' );
@@ -5296,6 +5339,7 @@
                     $return_code = 'FC';
                     $return_code = 'FU' if $friend_requires_captcha;
                 }
+
             }
             # Check for "already your friend"
             elsif ( $page =~ /already one of your friend/io ) {

Modified: trunk/libwww-myspace-perl/t/login-forms/latest.html
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-myspace-perl/t/login-forms/latest.html?rev=27132&op=diff
==============================================================================
--- trunk/libwww-myspace-perl/t/login-forms/latest.html (original)
+++ trunk/libwww-myspace-perl/t/login-forms/latest.html Sat Nov 22 16:36:07 2008
@@ -1,16 +1,16 @@
 <form action="http://secure.myspace.com/index.cfm?fuseaction=login.process" method="post" name="aspnetForm" id="LoginForm">
-<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTU4OTgyNDc1ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQU0Y3RsMDAkY3RsMDAkY3BNYWluJGNwTWFpbiRMb2dpbkJveCRSZW1lbWJlcl9DaGVja2JveA==" />
+<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTU4OTgyNDc1ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUnY3RsMDAkY3BNYWluJExvZ2luQm94JFJlbWVtYmVyX0NoZWNrYm94" />
 <input type="hidden" name="NextPage" id="NextPage" value="" />
 <label for="&lt;%= Email_Textbox.ClientID %>" >">Email:</label>
-<input type="text" name="ctl00$ctl00$cpMain$cpMain$LoginBox$Email_Textbox" id="ctl00_ctl00_cpMain_cpMain_LoginBox_Email_Textbox" />
+<input type="text" name="ctl00$cpMain$LoginBox$Email_Textbox" id="ctl00_cpMain_LoginBox_Email_Textbox" />
 <label for="&lt;%= Password_Textbox.ClientID %>" >">Password:</label>
-<input type="password" name="ctl00$ctl00$cpMain$cpMain$LoginBox$Password_Textbox" id="ctl00_ctl00_cpMain_cpMain_LoginBox_Password_Textbox" />
-<input type="checkbox" name="ctl00$ctl00$cpMain$cpMain$LoginBox$Remember_Checkbox" id="ctl00_ctl00_cpMain_cpMain_LoginBox_Remember_Checkbox" value="on" />
+<input type="password" name="ctl00$cpMain$LoginBox$Password_Textbox" id="ctl00_cpMain_LoginBox_Password_Textbox" />
+<input type="checkbox" name="ctl00$cpMain$LoginBox$Remember_Checkbox" id="ctl00_cpMain_LoginBox_Remember_Checkbox" value="on" />
 <label >Remember Me</label>
 <input type="submit" name="dlb" id="dlb" value="Log In" />
-<input type="hidden" name="ctl00$ctl00$cpMain$cpMain$LoginBox$SingleSignOnHash" id="ctl00_ctl00_cpMain_cpMain_LoginBox_SingleSignOnHash" />
-<input type="hidden" name="ctl00$ctl00$cpMain$cpMain$LoginBox$SingleSignOnRequestUri" id="ctl00_ctl00_cpMain_cpMain_LoginBox_SingleSignOnRequestUri" />
-<input type="hidden" name="ctl00$ctl00$cpMain$cpMain$LoginBox$nexturl" id="ctl00_ctl00_cpMain_cpMain_LoginBox_nexturl" />
-<input type="hidden" name="ctl00$ctl00$cpMain$cpMain$LoginBox$apikey" id="ctl00_ctl00_cpMain_cpMain_LoginBox_apikey" />
-<input type="hidden" name="ctl00$ctl00$cpMain$cpMain$LoginBox$ContainerPage" id="ctl00_ctl00_cpMain_cpMain_LoginBox_ContainerPage" />
+<input type="hidden" name="ctl00$cpMain$LoginBox$SingleSignOnHash" id="ctl00_cpMain_LoginBox_SingleSignOnHash" />
+<input type="hidden" name="ctl00$cpMain$LoginBox$SingleSignOnRequestUri" id="ctl00_cpMain_LoginBox_SingleSignOnRequestUri" />
+<input type="hidden" name="ctl00$cpMain$LoginBox$nexturl" id="ctl00_cpMain_LoginBox_nexturl" />
+<input type="hidden" name="ctl00$cpMain$LoginBox$apikey" id="ctl00_cpMain_LoginBox_apikey" />
+<input type="hidden" name="ctl00$cpMain$LoginBox$ContainerPage" id="ctl00_cpMain_LoginBox_ContainerPage" />
 </form>




More information about the Pkg-perl-cvs-commits mailing list