How Can I Login To Tumblr Using cURL PHP?

I’ve been trying to login to 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 = "";

> $post_fields = "";

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.