Kiko has asked for the wisdom of the Perl Monks concerning the following question:

Hello Everyone, I'm trying to create a file that has a login name and a password. There will be a link pointing to this file. When i click on the link, it will go to www.mail.yahoo.com and insert the login and passwd wihtout me having to type it. Then i will be in my mailbox. Can someone get me started or point me in the right direction; Thanks. -Kiko

Replies are listed 'Best First'.
Re: By Passing
by chromatic (Archbishop) on Jun 16, 2000 at 22:44 UTC
    I believe Yahoo checks for a cookie and then lets you in. If so, you might have a look at LWP::UserAgent and HTTP::Cookies.

    Even better, you can do this (from the docs):

    $cookie_jar = HTTP::Cookies::Netscape->new( File => "$ENV{HOME}/.netscape/cookies", AutoSave => 1, );
    That'll give your cookie jar access to existing Netscape cookies. From there, you can save them to another file, clear the Netscape cookie, and be in business. (Though how this will work without your program acting as a proxy server of some sort is beyond me.)
Re: By Passing
by le (Friar) on Jun 16, 2000 at 21:26 UTC
    One solution (not quite perl):
    find out what the names of the HTML form fields at the Yahoo website are (look at the source code), then generate your own HTML page with a form and some hidden <input> tags, naming login and password, and a submit button. Point the form to the location the original Yahoo form points to.

    Should work, but: very insecure.
      Hey, Thanks for your response. I've done that will other sites, but what if there is no action in the form tag (i.e, <form>). I guess that what i'm trying to do is to write a function or subroutine that will pass in the parameters and submit the form. I don't know if this will be possible. Thanks, Kiko
        If there is no action in the form tag, there parameters are sent back to the same script.