r30266 - in /branches/upstream/libwww-myspace-perl/current: Changes META.yml lib/WWW/Myspace.pm t/login-forms/latest.html

bricas-guest at users.alioth.debian.org bricas-guest at users.alioth.debian.org
Fri Jan 30 12:52:09 UTC 2009


Author: bricas-guest
Date: Fri Jan 30 12:52:05 2009
New Revision: 30266

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

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/login-forms/latest.html

Modified: branches/upstream/libwww-myspace-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-myspace-perl/current/Changes?rev=30266&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/Changes (original)
+++ branches/upstream/libwww-myspace-perl/current/Changes Fri Jan 30 12:52:05 2009
@@ -1,4 +1,12 @@
 Revision history for WWW::Myspace
+
+0.92    2009-01-29
+        - Fixed get_inbox 'sender' field again;  was returning undef due to a
+          couple of Myspace HTML changes made since 2008-12-05
+        - Fixed post_blog, which had stopped working after Myspace added new
+          JavaScript to the blog editor (RT#41844)
+        - Fixed friend_url;  was returning 'undef' for some profiles due to
+          Myspace HTML changes
 
 0.91    2008-11-20
         - Fixed approve_friend_requests which was no longer working as a result

Modified: branches/upstream/libwww-myspace-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-myspace-perl/current/META.yml?rev=30266&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/META.yml (original)
+++ branches/upstream/libwww-myspace-perl/current/META.yml Fri Jan 30 12:52:05 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               WWW-Myspace
-version:            0.91
+version:            0.92
 abstract:           Access MySpace.com profile information from Perl
 author:
     - Grant Grueninger <grantg at cpan.org>

Modified: branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm?rev=30266&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm (original)
+++ branches/upstream/libwww-myspace-perl/current/lib/WWW/Myspace.pm Fri Jan 30 12:52:05 2009
@@ -1,7 +1,7 @@
 #####################################################################
 # WWW::Myspace.pm
 # Sccsid:  %Z%  %M%  %I%  Delta: %G%
-# $Id: Myspace.pm 655 2008-11-20 05:52:58Z s-chamberlain $
+# $Id: Myspace.pm 656 2009-01-29 13:22:42Z s-chamberlain $
 ######################################################################
 # Copyright (c) 2005 Grant Grueninger, Commercial Systems Corp.
 #
@@ -43,11 +43,11 @@
 
 =head1 VERSION
 
-Version 0.91
-
-=cut
-
-our $VERSION = '0.91';
+Version 0.92
+
+=cut
+
+our $VERSION = '0.92';
 
 =head1 WARNING
 
@@ -187,7 +187,7 @@
 
 my %regex = (
     friend_id => qr/fuseaction=mail\.message&friendID=([0-9]+)/o,
-    friend_url => qr/www.myspace.com\/(\w*)\W+<\/title>/oixsm,
+    friend_url => qr/<a [^>]*href=\"http:\/\/www\.myspace\.com\/(\w+)\"[^>]*>www\.myspace\.com\/\1<\/a>/oixsm,
     friend_link => qr/fuseaction=user\.viewprofile\&(amp;)?friendid=([0-9]+)/oism,
     friend_img  => qr/fuseaction=user\.viewprofile\&(amp;)?friendID=([0-9]+)[^<]+<\s*img\b[^<]+\bsrc\s*=\s*["']?(.*?)["'\s>]/oism,
     #friend_img  => qr/fuseaction=user\.viewprofile\&(amp;)?friendID=([0-9]+)["'\s>&][^<]*<\s*img\b[^<]+\bsrc\s*=\s*["']?(.*?)["'\s>]/oism,
@@ -4399,9 +4399,9 @@
 	if(/<td\s[^>]*class="(?:.* )?messageListCell(?: .*)?"[^>]*>/){
 		# Found beginning of Message block
 		$state = 1;
-	} elsif (/viewprofile\&(?:amp;)?friendid=([0-9]+)"[^>]*\stitle="([^"]+)"[^>]*>/ && $state == 1){
-		$sender = $1;
-                $sendername = $2;
+	} elsif (/<a\s+title="([^"]+)"\s[^>]*href="[^"]+viewProfile\&(?:amp;)?friendID=([0-9]+)(?:\&[^"]+)?"[^>]*>/i && $state == 1){
+                $sendername = $1;
+		$sender = $2;
 	} elsif (/(Unread|Read|Sent|Replied)/ && $state == 1){
 		$status = $1;
 	} elsif (/messageID=([^&]+)&.*?>(.+?)<\/a>/ && $state == 1){
@@ -5927,32 +5927,41 @@
                      'Go To Advanced Editor'
                    ) or return undef;
 
-    # Get Mytoken
-    $self->current_page->decoded_content =~ /Mytoken=([A-Za-z0-9\-]+)/;
-    my $token = $1;
+    my $preview_button_name = ($self->current_page->decoded_content =~ /name=\"([^"]*btnPreview)"/i)[0];
+    my $subject_input_name = ($self->current_page->decoded_content =~ /name=\"([^"]*txbTitle)"/i)[0];
+    my $body_input_name = 'body';
+
+    # JavaScript seems to fill in these form fields
+    my $hd_body_input_name = ($self->current_page->decoded_content =~ /name=\"([^"]*hdBody)"/i)[0];
+    my $hd_category_id_input_name = ($self->current_page->decoded_content =~ /name=\"([^"]*hdCategoryId)"/i)[0];
+    my $hd_mood_id_input_name = ($self->current_page->decoded_content =~ /name=\"([^"]*hdMoodId)"/i)[0];
 
     # Fill and in post the blog
     ( $DEBUG ) && warn "Submitting initial blog form\n";
+    ( $DEBUG ) && warn "Clicking button named '$preview_button_name'\n";
     $self->submit_form( {
         form_no => 1,
         fields_ref => {
-            subject => $options{subject},
-            body => $options{body},
+            $subject_input_name => $options{subject},
+            $body_input_name => $options{body},
+            $hd_body_input_name => $options{body},
+            $hd_category_id_input_name => 0,
+            $hd_mood_id_input_name => 0
         },
-        # They use JavaScript to reset the action of the form...
-        action => 'http://blog.myspace.com/index.cfm?fuseaction=blog.previewBlog&Mytoken='.
-                  $token,
-        no_click => 1,
+        button => $preview_button_name,
         re2 => 'Confirm Blog Posting'
     } ) or return undef;
 
+
+    my $confirm_button_name = ($self->current_page->decoded_content =~ /name=\"([^"]*btnSubmit2)"/i)[0];
+
     # Post the confirmation, unless we're in test mode.
     ( $DEBUG ) && warn "Posting blog confirmation\n";
+    ( $DEBUG ) && warn "Clicking button named '$confirm_button_name'\n";
     unless ( $options{testing} ) {
         $self->submit_form( {
             form_no => 1,
-            action => 'http://blog.myspace.com/index.cfm?fuseaction=blog.processCreate',
-            no_click => 1,
+            button => $confirm_button_name
         } ) or return undef;
     }
 

Modified: branches/upstream/libwww-myspace-perl/current/t/login-forms/latest.html
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-myspace-perl/current/t/login-forms/latest.html?rev=30266&op=diff
==============================================================================
--- branches/upstream/libwww-myspace-perl/current/t/login-forms/latest.html (original)
+++ branches/upstream/libwww-myspace-perl/current/t/login-forms/latest.html Fri Jan 30 12:52:05 2009
@@ -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="/wEPDwUJNTU4OTgyNDc1ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUnY3RsMDAkY3BNYWluJExvZ2luQm94JFJlbWVtYmVyX0NoZWNrYm94" />
+<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMzYzMTA4NTc1ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQU0Y3RsMDAkY3RsMDAkY3BNYWluJGNwTWFpbiRMb2dpbkJveCRSZW1lbWJlcl9DaGVja2JveA==" />
 <input type="hidden" name="NextPage" id="NextPage" value="" />
 <label for="&lt;%= Email_Textbox.ClientID %>" >">Email:</label>
-<input type="text" name="ctl00$cpMain$LoginBox$Email_Textbox" id="ctl00_cpMain_LoginBox_Email_Textbox" />
+<input type="text" name="ctl00$ctl00$cpMain$cpMain$LoginBox$Email_Textbox" id="ctl00_ctl00_cpMain_cpMain_LoginBox_Email_Textbox" />
 <label for="&lt;%= Password_Textbox.ClientID %>" >">Password:</label>
-<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" />
+<input type="password" name="ctl00$ctl00$cpMain$cpMain$LoginBox$Password_Textbox" id="ctl00_ctl00_cpMain_cpMain_LoginBox_Password_Textbox" />
+<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="submit" name="dlb" id="dlb" value="Log In" />
+<input type="checkbox" name="ctl00$ctl00$cpMain$cpMain$LoginBox$Remember_Checkbox" id="ctl00_ctl00_cpMain_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$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