quasiman Posted October 5, 2008 Share Posted October 5, 2008 I'm using a curl script to login to my facebook account, and now that they're switching to the "new" look, I had to change the url in my curl. It still works fine, but only for my account. If I login to a brand new facebook account, the "new" portion in the url isn't there. IE: http://www.facebook.com/home.php?ref=home and http://www.new.facebook.com/home.php?ref=home So my question, how do I make the curl script know which version I'm logging into? My login script: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php'); curl_setopt($ch, CURLOPT_POSTFIELDS,'email='.urlencode($login_email).'&pass='.urlencode($login_pass).'&login=Login'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIEJAR, $face_cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $face_cookie); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); curl_exec($ch); Quote Link to comment Share on other sites More sharing options...
Acs Posted October 5, 2008 Share Posted October 5, 2008 Try changing the CURLOPT_URL to the correct address I think And why are you saying to return the transfer if you are calling the exec and not putting the return value in a var or something?? Quote Link to comment Share on other sites More sharing options...
quasiman Posted October 5, 2008 Author Share Posted October 5, 2008 the login itself is fine, but once logged in the user (or curl script) is redirected to either of the above addresses...depending on when their account was created. My older facebook account has the "new", while my account created yesterday does not. you're right, it should be curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); Quote Link to comment Share on other sites More sharing options...
quasiman Posted October 5, 2008 Author Share Posted October 5, 2008 Nevermind, they seem to have stopped using the "new" url....lol, good timing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.