r18518 - in /branches/upstream/libwww-myspace-perl/current: Changes META.yml lib/WWW/Myspace.pm t/01-login.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Sat Apr 12 19:25:34 UTC 2008


Author: gregoa-guest
Date: Sat Apr 12 19:25:33 2008
New Revision: 18518

URL: http://svn.debian.org/wsvn/?sc=1&rev=18518
Log:
[svn-upgrade] Integrating new upstream version, libwww-myspace-perl (0.77)

Modified:
    branches/upstream/libwww-myspace-perl/current/Changes
    branches/upstream/libwww-myspace-perl/current/META.yml
    branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm
    branches/upstream/libwww-myspace-perl/current/t/01-login.t

Modified: branches/upstream/libwww-myspace-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libwww-myspace-perl/current/Changes?rev=18518&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/Changes (original)
+++ branches/upstream/libwww-myspace-perl/current/Changes Sat Apr 12 19:25:33 2008
@@ -1,4 +1,28 @@
 Revision history for WWW::Myspace
+
+0.77   2008-04-11
+        - MAINTENANCE RELEASE NOTE:
+          Several methods are still not working due
+          to changes in myspace forms.  As such, the tests will probably fail.
+          Do a "force install" - this version is at least better than what
+          you have now. :)
+          PLEASE SUBMIT PATCHES if you are able as we (the developers) really
+          busy at the moment and I'm not sure when we'll be able to go through
+          and update things.
+          Only through the group effort that is the strength of open source
+          programming can this module evolve as quickly as a site as dynamic
+          as Myspace.
+          Thanks! - Grant
+
+        - send_friend_request now takes either a single message as a string,
+          or an arrayref of messages for the value of $message.  If passed an
+          arrayref, send_friend_request will pick one of the messages at random
+          to include with the friend request.
+        - Applied patch by steven [...] pyro.eu.org that fixes login form
+          change 4/11/08
+
+0.76    2008-04-11
+        - Bad release - patch not applied due to svn problems.
 
 0.75    2008-01-17
         - Removed badly programmed "die" statement that could cause the module to

Modified: branches/upstream/libwww-myspace-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libwww-myspace-perl/current/META.yml?rev=18518&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/META.yml (original)
+++ branches/upstream/libwww-myspace-perl/current/META.yml Sat Apr 12 19:25:33 2008
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         WWW-Myspace
-version:      0.75
+version:      0.77
 version_from: lib/WWW/Myspace.pm
 installdirs:  site
 requires:

Modified: branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm?rev=18518&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm (original)
+++ branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm Sat Apr 12 19:25:33 2008
@@ -1,7 +1,7 @@
 ######################################################################
 # WWW::Myspace.pm
 # Sccsid:  %Z%  %M%  %I%  Delta: %G%
-# $Id: Myspace.pm 562 2008-01-26 07:24:34Z grantg $
+# $Id: Myspace.pm 570 2008-04-11 22:44:35Z grantg $
 ######################################################################
 # Copyright (c) 2005 Grant Grueninger, Commercial Systems Corp.
 #
@@ -42,11 +42,11 @@
 
 =head1 VERSION
 
-Version 0.75
-
-=cut
-
-our $VERSION = '0.75';
+Version 0.77
+
+=cut
+
+our $VERSION = '0.77';
 
 =head1 WARNING
 
@@ -629,22 +629,38 @@
     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$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$Main$SplashDisplay$ctl00$Login_ImageButton',
-    #                        '__EVENTARGUMENT' => '',
+                            '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,
@@ -652,6 +668,7 @@
     } 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' :
@@ -4590,6 +4608,18 @@
 message wasn't seen either.  This means it -might- have gone through,
 but probably not.  Of course, worst case here is you try again.
 
+Advanced features: If $message contains an array reference, send_friend_request
+will pick one of the elements at random as the message to send.  This means
+you can do:
+
+ $myspace->send_friend_request( $friend_id,
+     [ 'Hi!  I thought I\'d send you a message",
+       'Hello!  I saw your profile and wanted to add you.',
+       'Hi, I\'m just adding you at random, hope you\'ll accept!'
+     ]
+ );
+
+This can help add a bit more feeling to your requests.
 
  EXAMPLES
  
@@ -4664,6 +4694,10 @@
     my ($page, $res);
     my $captcha_result = "";
 
+    # If they passed an array reference, pick a message at random
+    if ( ref $message eq 'ARRAY' ) {
+        $message = $message->[ int( rand( @$message ) ) ]
+    }        
     # Convert newlines (\n) into socket-ready CRLF ASCII characters.
     # This also takes care of possible literal "\n"s that come
     # from command-line arguments.

Modified: branches/upstream/libwww-myspace-perl/current/t/01-login.t
URL: http://svn.debian.org/wsvn/branches/upstream/libwww-myspace-perl/current/t/01-login.t?rev=18518&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/t/01-login.t (original)
+++ branches/upstream/libwww-myspace-perl/current/t/01-login.t Sat Apr 12 19:25:33 2008
@@ -32,7 +32,8 @@
 	"is_band identifies 3rd party non-band profile correctly" );
 	
 #Test get_profile_type for individuals
-is( $myspace->get_profile_type( 76959716), 1,
+#76959716
+is( $myspace->get_profile_type( 123557), 1,
 	"get_profile_type identifies personal profile correctly" );
 
 #Test get_profile_type for music
@@ -191,4 +192,4 @@
         "get_birthday returned a friendID and valid-looking birthday" ) or
         warn "get_birthday got friendID " . $bd[0] . ", Bday: " . $bd[1] . " and ".
              "returned " . @bd / 2 . " birthdays.\n";
-}
+}




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