Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

check email needs cookies

by Anonymous Monk
on Aug 18, 2003 at 21:43 UTC ( [id://284737]=perlquestion: print w/replies, xml ) Need Help??

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

I am trying to create a simple program that will check a website for new email. The website is of the form;

http://mail.mybudweiser.com/chekin.php?email=myname@budweiser.com&password=mypassword

If I load this URL my browser, I get to my email inbox screen no problems, so I thought I could use LWP to get this url & parse the text within the resulting page for new mail notification. My problem is, when I fetch the url with LWP it is not working as it doesn't allow the site to set its cookie. I have read a lot of posts about cookies and have become totally confused, I don't know weather I'm supopsed to get/set/send or retrieve a cookie in order for this to work. Please help!

Replies are listed 'Best First'.
Re: check email needs cookies
by arthas (Hermit) on Aug 18, 2003 at 22:32 UTC

    Hi!

    LWP fully supports cookies. They are however disabled by default, and you should create a cookie jar. The LWP cookbook document (lwpcook) explains you how to do this easily.

    Hope this helps!

    Michele.

Re: check email needs cookies
by esh (Pilgrim) on Aug 19, 2003 at 00:10 UTC

    My favorite CPAN package for doing things like this is WWW:Mechanize

    It realy simplifies the task of writing scripts that log into web sites, click on links, fill out forms, and all the rest.

    It takes a bit of time to figure out exactly how to use it, but study the examples and write some samples, and soon you'll be coming up with all sorts of excuses to write new programs with WWW:Mechanize.

    -- Eric Hammond

Re: check email needs cookies
by aquarium (Curate) on Aug 18, 2003 at 22:58 UTC
    if the website is using "standard" authentication...then the password is embedded in the url differently..like so:
    http://username:password@www.webemailservice.com
    might be https (if they care about security) as the username and password are only uuencoded and not crypted.
Re: check email needs cookies
by chunlou (Curate) on Aug 18, 2003 at 22:39 UTC
    Does the host support POP3 as well (since you could use Net::POP3 also)? Though it might not be what you really did, "...password=mypassword" looks troubling. It's a good practice to set your "agent" in LWP to some meaningful name if you haven't done so.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-16 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found