slugger415 has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I've been using a Perl script for a couple of years to retrieve FaceBook event listings. It's worked fine until the last couple of months, and I'm very often getting this message:
Status read failed: A non-blocking socket operation could not be completed immediately. at C:/Strawberry/perl/vendor/lib/Net/HTTP/Methods.pm line 276.I've searched around and couldn't find anything that explains what this means or what to do about it. Oddly, once in a while the script still works.
Here's a bit of my login code. I'm running on Windows 7 with Strawberry Perl v5.20.2.
use CGI; use File::Basename; use LWP::UserAgent; use strict; my %postLoginData; #necessary post data for login $postLoginData{'email'}=$email; $postLoginData{'pass'}=$password; $postLoginData{'persistent'}=1; $postLoginData{'login'}='Login'; our $response; #holds the response the HTTP requests #set the headers, let's make this a Firefox browser! our @header = ('Referer'=>'http://www.facebook.com', 'User-Agent'=>$us +er_agent); our $cookie_jar = HTTP::Cookies->new(file=>'fbkCookies.dat',autosave=> +1, ignore_discard=>1); our $browser = LWP::UserAgent->new; #init browser $browser->cookie_jar($cookie_jar); print " getting fb login...\n"; $browser->get('http://www.facebook.com/login.php',@header); print " posting login request...\n"; #here we actually login! $response = $browser->post('https://login.facebook.com/login.php',\%po +stLoginData,@header); #was login successful? if($response->content =~ /Incorrect Email/) { print "Login Failed...Quitting..\n"; exit; } else { print "..and we are in!\n\n"; #let's go to the homepage my $pageresponse = $browser->get( $url ,@header); # this is where the error appears: print $$pageresponse{_content};
I know there are FB modules out there that probably work better, but I'd like to understand what's happening here, if anyone has seen it before. Many thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A non-blocking socket operation could not be completed ?
by BrowserUk (Patriarch) on May 16, 2016 at 23:15 UTC | |
by ikegami (Patriarch) on May 16, 2016 at 23:23 UTC | |
by slugger415 (Monk) on May 17, 2016 at 14:28 UTC | |
|
Re: A non-blocking socket operation could not be completed ?
by Marshall (Canon) on May 16, 2016 at 22:45 UTC | |
by slugger415 (Monk) on May 17, 2016 at 14:35 UTC | |
by Marshall (Canon) on May 17, 2016 at 17:58 UTC |