Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: john [...] deedevelopments.com
jworkman [...] pimpworks.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.82
Fixed in: 0.84



Subject: msend_friend_request broke aswell?
Date: Mon, 11 Aug 2008 12:04:55 +0800
To: bug-WWW-Myspace [...] rt.cpan.org
From: John Hale <john [...] deedevelopments.com>
I am doing the following code: my @friends; @friends = $myspace->friends_from_profile('157631228'); warn $myspace->error if ( $myspace->error ); # Send a bunch of friend requests my @posted = (); my @failed = (); foreach my $friend ( @friends ) { print "Posting to $friend: "; my $status = $myspace->send_friend_request( $friend ); if ( $status =~ /^P/ ) { print "Succeeded\n"; push ( @posted, $friend ); } else { print "Failed with code $status\n"; push ( @failed, $friend ); } # Stop if we got a CAPTCHA request. last if $status eq 'FC'; } # Do what you want with @posted and @failed. print "Accpted Friends\n"; print @posted; Posting to 107240945: Failed with code FN No Add to Friends button on form! Posting to 112723355: Failed with code F No Add to Friends button on form! Posting to 113369715: Failed with code F No Add to Friends button on form! Posting to 11598097: Failed with code F Posting to 117992667: Failed with code FA No Add to Friends button on form! Posting to 118653445: Failed with code F No Add to Friends button on form! Posting to 122950073: Failed with code F No Add to Friends button on form! Posting to 125398943: Failed with code F No Add to Friends button on form! Posting to 125673768: Failed with code F No Add to Friends button on form! Posting to 132314966: Failed with code F No Add to Friends button on form! Posting to 132630082: Failed with code F
Subject: send_friend_request broke aswell?
Hi, Thanks for reporting this. Some changes at Myspace had broken the function completely. It seems there are no tests for this function either, so it wasn't immediately obvious that something was wrong. I committed a fix to SVN as R-611 and I've manually verified that it now sends a friend request. It also sends the note/message along with request. Please let us know if you notice any other problems with the function. I'm unable to tell right now if the correct status codes are returned in response to various eventualities (like receiving a CAPTCHA). Hopefully some tests can be written soon. Thanks again.
Subject: Re: [rt.cpan.org #38385] send_friend_request broke aswell?
Date: Tue, 12 Aug 2008 13:13:04 +0800
To: bug-WWW-Myspace [...] rt.cpan.org
From: John Hale <john [...] deedevelopments.com>
Seems to work a bit more now :) osting to 148357100: Failed with code FN Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Parsing of undecoded UTF-8 will give garbage when decoding entities at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ PullParser.pm line 83. Posting to 148670411: Failed with code FN Posting to 149009045: Failed with code FU Posting to 151318023: Failed with code FU Posting to 153440060: Failed with code FU Posting to 155725926: Failed with code FU Posting to 156442553: Failed with code FU Posting to 157631228: Failed with code FU Posting to 157633604: Failed with code FU Getting alot of these failed codes. On Aug 12, 2008, at 9:13 AM, Steven Chamberlain via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=38385 > > > Hi, > > Thanks for reporting this. Some changes at Myspace had broken the > function completely. It seems there are no tests for this function > either, so it wasn't immediately obvious that something was wrong. > > I committed a fix to SVN as R-611 and I've manually verified that it > now > sends a friend request. It also sends the note/message along with > request. Please let us know if you notice any other problems with the > function. > > I'm unable to tell right now if the correct status codes are > returned in > response to various eventualities (like receiving a CAPTCHA). > Hopefully > some tests can be written soon. > > Thanks again. >
Subject: send_friend_request() brokenness
Myspace has made several changes to their site that breaks Myspace.pm. Among them: 1. They changed the name of the form button to submit a friend request. 2. They changed the confirmation string when a friend request has been successfully sent. I have attached a patch against SVN which aims to fix these two problems.
Subject: Myspace.pm.patch
*** Myspace.pm.bak Mon Aug 11 15:52:53 2008 --- Myspace.pm Mon Aug 11 22:44:38 2008 *************** *** 4941,4947 **** # You might want to change this whole section to: # do { $res = $self->get_page ... ; # $attempts++; } until ( ( $attempts > 20 ) || ( $page =~ /<input type="submit" ...) ); ! elsif ( $page !~ /ctl00\$cpMain\$btnAddToFriends/io ) { $return_code ='F'; warn "No Add to Friends button on form!\n"; } --- 4941,4947 ---- # You might want to change this whole section to: # do { $res = $self->get_page ... ; # $attempts++; } until ( ( $attempts > 20 ) || ( $page =~ /<input type="submit" ...) ); ! elsif ( $page !~ /\$AddFriendRequestButtons\$btnAddToFriends/io ) { $return_code ='F'; warn "No Add to Friends button on form!\n"; } *************** *** 4972,4981 **** } else { $res = $self->submit_form( { form_name => 'aspnetForm', ! button => 'ctl00$cpMain$btnAddToFriends', no_click => 1, fields_ref => { ! '__EVENTTARGET' => 'ctl00$cpMain$btnAddToFriends', 'ctl00$cpMain$NoteToFriend$Note' => $message } } ); --- 4972,4981 ---- } else { $res = $self->submit_form( { form_name => 'aspnetForm', ! button => 'ctl00$ctl00$ctl00$cpMain$cpMain$cpfMainBody$AddFriendRequestButtons$btnAddToFriends', no_click => 1, fields_ref => { ! '__EVENTTARGET' => 'ctl00$ctl00$ctl00$cpMain$cpMain$cpfMainBody$AddFriendRequestButtons$btnAddToFriends', 'ctl00$cpMain$NoteToFriend$Note' => $message } } ); *************** *** 4995,5001 **** $page =~ s/[ \t\n\r]+/ /go; # Check for success ! if ( $page =~ /An email has been sent to the user/io ) { $return_code = 'P'; last; } --- 4995,5001 ---- $page =~ s/[ \t\n\r]+/ /go; # Check for success ! if ( $page =~ /A friend request has been sent to this user/io ) { $return_code = 'P'; last; }
CC: Developer communication list <www-myspace-devel [...] lists.sourceforge.net>
Subject: Re: [rt.cpan.org #38418] send_friend_request() brokenness
Date: Tue, 12 Aug 2008 18:41:08 +0100
To: bug-WWW-Myspace [...] rt.cpan.org
From: Steven Chamberlain <steven [...] pyro.eu.org>
Jeff Workman via RT wrote: Show quoted text
> Myspace has made several changes to their site that breaks Myspace.pm. > Among them: > > 1. They changed the name of the form button to submit a friend request. > 2. They changed the confirmation string when a friend request has been > successfully sent. > > I have attached a patch against SVN which aims to fix these two problems.
Hi, You're absolutely right, and your patch fixes those two problems, but I'm sorry to say that I'd already committed a fix to SVN some hours earlier as R-611. Thank you anyway for your patch. There was also a change in the form input name for the note/message sent with the friend request; commit R-611 should have fixed that also. The problem was reported as RT#38385 which I marked as closed after committing the fix to SVN. It has since been re-opened as it seems there could still be other problems. http://rt.cpan.org/Ticket/Display.html?id=38385 Perhaps it is best in future for us not to mark a bug as resolved in RT until a new release has been published via CPAN containing the fix? Regardless, I think a 0.83 release is necessary soon because this important feature and others are broken in 0.82. There are a few other minor features broken as shown by 'make test' which I'll try to fix now. Regards, -- Steven Chamberlain steven@pyro.eu.org
Subject: Re: [rt.cpan.org #38385] send_friend_request broke aswell?
Date: Tue, 12 Aug 2008 18:59:59 +0100
To: bug-WWW-Myspace [...] rt.cpan.org
From: Steven Chamberlain <steven [...] pyro.eu.org>
John Hale via RT wrote: Show quoted text
> Seems to work a bit more now :)
Show quoted text
> Parsing of undecoded UTF-8 will give garbage when decoding entities > at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/HTML/ > PullParser.pm line 83.
BTW, those warnings can be ignored for now, but we're looking to get rid of them. Show quoted text
> Posting to 148670411: Failed with code FN
"Failed, network error" may happen occasionally. I believe only one attempt is made to send the friend request, but eventually the function should be modified to do that itself. Until then you could perhaps alter your script to retry a few times if it receives an "FN" response. Show quoted text
> Posting to 149009045: Failed with code FU > Posting to 151318023: Failed with code FU > Posting to 153440060: Failed with code FU > Posting to 155725926: Failed with code FU > Posting to 156442553: Failed with code FU > Posting to 157631228: Failed with code FU > Posting to 157633604: Failed with code FU
"Failed, CAPTCHA response required by user" I've checked one of these accounts manually and it didn't require a CAPTCHA. I suspect that you'd made a certain number of friend requests, and Myspace was requesting that you answer a CAPTCHA before you could send any more. The function should have been returning "FC" instead, but it's possible that it's returning the wrong code at the moment. If that's what's happening, you should be able to log into the account manually and try adding one of those friend IDs. I suspect it would show you a CAPTCHA, and after you complete it, your script should work normally again for some time, until the next time it happens. Regards, -- Steven Chamberlain steven@pyro.eu.org