cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Using curl to get Yahoo mail

From: Jacky Lam <sylam_at_emsoftltd.com>
Date: Thu, 28 Mar 2002 15:51:28 +0800

>
> I don't have any specific answers to your specific problem, but in general
> you need to 1) get a page (use present cookiejar, store cookiejar) 2)
> follow redirects. 3) parse the result, if there are more links to get, goto
> 1.

        Also, the yahoo mail login page requires some javascript to determine what
browser you are. If the action you perform doesn't match your user-agent
setting, failure will result.

        /* I have tried my best to remember, but the main procedure is like this */

        The simplest case is:
        (User agent set to something like Links, lynx, unknown, but not mozilla;
otherwise, the server will be more demanding)
        1. Get mail.yahoo.com
        2. Redirected to login.mail.yahoo.com ( You will get a cookie "B" here)
        3. Find and fill all the form entry and formulate a POST request
        4. Send our the Post request with the Cookie you have (referer filled with
login.mail.yahoo.com)
        5. Then, you should get a redirect reply with 3/4 more cookies ("T", "Y",
....)
        6. Then, just get the redirected URL with all the cookies you have.
        
Received on 2002-03-28