Subject: | PATCH: fix login & posting for current use Perl |
use Perl recently upgraded, and this module no longer works. The login
text it checks for is gone, so I found some new text.
Also, you have to wait a bit before submitting a form or it tells you to
wait a little bit. I added a sleep, and an explicit check for that error
too.
Subject: | WUPJ.patch |
diff -ru ../WUPJ/lib/WWW/UsePerl/Journal/Post.pm ./lib/WWW/UsePerl/Journal/Post.pm
--- ../WUPJ/lib/WWW/UsePerl/Journal/Post.pm 2008-09-04 13:37:06.000000000 -0500
+++ ./lib/WWW/UsePerl/Journal/Post.pm 2008-09-04 13:38:29.000000000 -0500
@@ -122,7 +122,7 @@
GET $UP_URL . "/users.pl?op=userlogin&unickname=$self->{username}&upasswd=$self->{password}"
)->content;
- return 1 if($login && $login =~ /This page was generated by .*? for $self->{username}/i);
+ return 1 if($login && $login =~ m{\QThis is <b>your</b> User Info page}i);
return;
}
@@ -184,8 +184,12 @@
op => 'save',
);
+ sleep 5;
my $post = $self->{ua}->request(POST $UP_URL . '/journal.pl', \%data);
+
return $self->{j}->error("Failed LWP POST request") unless $post->is_success;
+ return $self->{j}->error("Got the wait a little bit message") if $post->content =~ /wait a little bit/;
+
return 1;
}
Only in .: WUPJ.patch