Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: creating script that logs in to site under different names

by sulfericacid (Deacon)
on Mar 21, 2006 at 18:50 UTC ( [id://538257]=note: print w/replies, xml ) Need Help??


in reply to creating script that logs in to site under different names

This is actually quite simple. Unlike keeping the users available for chatting, all you need to do is get them signed in. Therefor you don't need to store the cookies like you normally would enabling you to do multi-logins.
use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $url = "url.here"; $mech->get( $url ); $mech->submit_form( form_number => 2, fields => { username => 'name', passwrd => 'pass', } ); my $mech2 = WWW::Mechanize->new(); $mech2->get( $url ); $mech2->submit_form( form_number => 2, fields => { username => 'name', passwrd => 'pass', } ); my $mech3 = WWW::Mechanize->new(); $mech3->get( $url ); $mech3->submit_form( form_number => 2, fields => { username => 'name', passwrd => 'pass', } ); print "done";
The above code is tested but there are other things to think about, too. You might want to randomly pull a few usernames each time so different users are signed in after each login session. It'll make it look more realistic to people who are looking at account profiles seeing the last access/login time for each user.

You could also add a flatfile database and use a logout script to randomly pull a name or two of your signed in users every X minutes, too.

This is the basics, but think about making it perform a little more realistic.



"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://538257]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found