I am just wondering if anyone out there has a curl script that will log into the comcast website for the account management.

This is the only one that i can not figure out as it seems to go through various stages for the log in process that I cannot follow. This is the first part of the script that I am using, it works for everything else, but not for comast.. :mad:

It then goes in into another post form with a ticketId and then it gets the main account, but everytime I get to that point, it asks me to login again.

	
$cookie_file_path = "comcast.txt";

$LOGINURL = "https://www.comcast.com/UserServices/Membership/LoginTicket.asmx/GetWorkTicket";
	$POSTFIELDS = 'userNameHidden=&userName=USERNAME&password=PASSWORD&FormType=1&';
    $reffer = "https://www.comcast.com/Corporate/Customers/CustomerCentral.html";
	$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL,$LOGINURL);
	curl_setopt($ch, CURLOPT_USERAGENT, $agent);
	curl_setopt($ch, CURLOPT_POST, 1); 
	curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_REFERER, $reffer);
	curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
	curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
	curl_setopt($ch, CURLOPT_FTP_SSL, CURLFTPSSL_TRY);
	$result = curl_exec ($ch); // execute the curl command
	curl_close ($ch);

    I did something similar with Time Warner back when they were my ISP to monitor the release of an email account I needed to move to another modem account...

    I believe there was some trickery by which once you logged in it generated a hidden form value or a request ID that had to be passed along the way from that point on... without it it would always ask me to login

      I did happen to notice it goes through several POSTS before it goes to the main account page, and I passed that ticketID that gets generated but it must not like me very much. You dont' happen to have your script that you are willing to share? 😃

        unfortunately that was about 5 years ago so it's not in my standard tool box, so I couldn't find it readily however it may be buried somewhere on my unix server

        what you are going to need it capture any and all variables/cookies from all post redirects along the way and send them back when you CURLOPT_FOLLOWLOCATION

        that being said, I only had to deal with passing a cookie, not following multiple levels of redirects

        perhaps if you post the base url that you are starting with, a member whose on comcast could take a look and provide some better feedback

          Write a Reply...