Thread

Posted on Sat Mar 11 02:19:55 2006 by plasma2002
kinda off-topic.....
this is kinda off topic, but you might be able to help me out with it...

ok, so we all know i run an aim bot that uses www::myspace..... well, sometimes the connection to myspace.com craps out on me (cant ping, whatever)

well, normally for most scripts, it would die with an error message..... which is what it does here too. But i cant really have it do that since the script has to stay running to keep the bot online :)


Now i know it has nothing to do with www::myspace, but rather one of the modules that are bing used from within wwwmyspace.

Would you happen to know what module is used that does the http connecting? (i know, im probably making myself sound super novice, but whatever)

I dont know what all the other modules do..... i came to Perl specifically for www::myspace... haha.... i only know how to get around as much as i do now cause ive been working with php for so long :P


anyways... any help on the matter would be apprecieated
Direct Responses: 1930 | Write a response
Posted on Sat Mar 11 02:50:05 2006 by grantg in response to 1929
Re: kinda off-topic.....
Well, it's LWP::UserAgent that handles the browser-like functions, but the script (or module) shouldn't "die" (in the literal Perl sense) just because it can't connect. The only case I'm aware of where the module will die is documented in the "Known Issues" section of the WWW::Myspace Perl docs (I think it has to do with commenting a non-friend or something).

Can you post the actual error message you get when it dies? (I know that might be tricky to nail down).

Direct Responses: 1933 | Write a response
Posted on Sun Mar 12 01:42:09 2006 by plasma2002 in response to 1930
Re: kinda off-topic.....
well, i wont be back to my comput5er til monday, but this is what i usually get....




Cannot connect to myspace.com
HTTP Response 500

Cannot connect to myspace.com
HTTP Response 500

Cannot connect to myspace.com
HTTP Response 500

Cannot connect to myspace.com
HTTP Response 500

Cannot connect to myspace.com
HTTP Response 500






(probably not exactly what it said, but thats the general idea)
then i just get a command line. So its obviously nothing wrong with the scripts, its just that myspace.com is being buggy (or at least my connection to it is)..... but i just dont want it to die after 5 retries. I need some way to be able to catch the error and handle it my own way

and like i said, i know this really isnt www::myspace related.... so if ya want, ill stop bloating this area up and head over to LWP now that i know what it is, haha :P

Direct Responses: 1934 | Write a response
Posted on Sun Mar 12 02:05:17 2006 by grantg in response to 1933
Re: kinda off-topic.....
LWP won't really help fix that.

WWW::Myspace tries the page 5 times if it gets an error. If you want it to try forever, try this:

my $myspace; do { $myspace = new WWW::Myspace( $username, $password ); } until ( $myspace->logged_in );
Direct Responses: 1940 | Write a response
Posted on Mon Mar 13 18:29:17 2006 by plasma2002 in response to 1934
Re: kinda off-topic.....
aha! :)

lol, totally forgot about logged_in
haha, thanx
Write a response