I'm using curl to login tumblr for some operations. I'm not using tumblr api because there are some other limitations.
As referred to some other posts. I using curl_init, then multiple curl_exec and close. But it doesn't seem to work. $result1 shows that I'm sucessfully login. But $result2 is empty.
$request_data = http_build_query(
array(
'email' => $tumblr_email,
'password' => $tumblr_password,
)
);
$c1 = curl_init('http://www.tumblr.com/login');
curl_setopt($c1, CURLOPT_POST, true);
curl_setopt($c1, CURLOPT_POSTFIELDS, $request_data);
curl_setopt($c1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c1, CURL_COOKIEFILE, '');
$result1 = curl_exec($c1);
curl_setopt($c1, CURLOPT_URL, 'http://www.tumblr.com/likes/page/2');
$result2 = curl_exec($c1);
curl_close($c1);