php - Automated Yahoo Mail login with cURL - how? -
i attempting create page curl instructions following:
take following link, send request it, , retrieve results.
http://login.yahoo.com/config/login?login=xxxxxxx&passwd=yyyyyyyy&.done=http://m.yahoo.com/mail
xxxxx - username yyyyy - password
easy, right? not really. since page returned, designed automatically log in yahoo mail inbox.
i tried with:
<?php // curl resource $curl = curl_init(); // set options - passing in useragent here curl_setopt_array($curl, array( curlopt_returntransfer => 1, curlopt_url => 'http://login.yahoo.com/config/login?login=xxxxxx&passwd=yyyyyyy&.done=http://m.yahoo.com/mail', curlopt_useragent => 'something-here' )); // send request & save response $resp $resp = curl_exec($curl); // close request clear resources curl_close($curl); echo $resp; ?> i response, it's yahoo mail login page. doesn't execute login , retrieve related yahoo inbox.
how go doing curl?
after extensive testing.. decided see why not working , interested in @sammitch's comment won't work..
i first tried using own http requests class login , failed. response stayed empty if visited url browser work. turned on developer tools in chrome , went network section , tried logging in
it seemed that page posted data page
http://login.yahoo.com/config/login_verify2?login=xxxxxx&passwd=yyyyyy&.done=http://m.yahoo.com/mail
after altering curl code work url directly signed me in.. solution question.. url using did not work , 1 should work shown above.
Comments
Post a Comment