How Can I Login To Tumblr Using cURL PHP?

I’ve been trying to login to Tumblr.com using cURL PHP.
I’ve also captured the right post data from Firefox Addon HTTPFox.
The problem is, when I echo out the value of $login_result only blank page shows up and nothing more than that.
What I want to do with Tumblr can only be done by authenticating yourself and I am not being able to proceed further more.

Thank you!

> <?php
> $ch = curl_init();

> $login_url = "https://www.tumblr.com/login";

> $post_fields = "user%5Bemail%5D=xxxxx%40gmail.com&user%5Bpassword%5D=xxxxxxxxxx&tumblelog%5Bname%5D=&user%5Bage%5D=&context=no_referer&version=STANDARD&follow=&form_key=%211231444806625%7CTDf9wvG6TTcfiWFiVgzvmI2NCUQ&seen_suggestion=0&used_suggestion=0&used_auto_suggestion=0&about_tumblr_slide=&random_username_suggestions=%5B%22StickyWizardPersona%22%2C%22DarkKidFest%22%2C%22DeliciouslyCyberBouquet%22%2C%22SuperbGoateeUnknown%22%2C%22SeverelyNumberOneEnemy%22%5D";

curl_setopt($ch, CURLOPT_URL, $login_url);

curl_setopt($ch, CURLOPT_USERAGENT, "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0");

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);

curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$login_result = curl_exec($ch);

?>

This will not work.
Tumblr won’t accept form data sent from another domain.
Otherwise it would be a huge CSRF vulnerability on their side.
Official API is the only way to interact with Tumblr in your case.

1 Like

Is it possible for us to interact with Tumblr as a browser not a domain?

And if it’s not possible with PHP, is it possible with any other language?

And about their official API, I don’t it will let me do what I want to do. :frowning:

First, you have to ask if Tumblr permits you to use it that way.
There is “Limitations on Automated Use” section in their ToS:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.