tumblr / tumblr.php Goto Github PK
View Code? Open in Web Editor NEWTumblr API v2 PHP Client
License: Apache License 2.0
Tumblr API v2 PHP Client
License: Apache License 2.0
I am getting "error 302 moved temporarily" just right after the user authentication in tumblr.com.
I also do not have a oauth_verifier echoed out. Is this normal?
I tried to install the dependencies via composer and then I copied lib/Tumblr/ to the root directory of my site. Then I followed the authentication code on this wiki page.
Hi,
I reblog a post like that:
$this->client->reblogPost($userBlogInfo->name, $post_id, $_POST["reblogKey"], $options = null)
How can I add tags to reblog?
Regards,
Michael
The example PHP code shown in the API console for getBlogPosts()
has the reblog_info
argument (if selected to be returned) being passed as Boolean true
. This is also what you would naturally expect to pass to the method.
However if you try to actually run the code that it gives you, you never get the reblog info that you expect. The only way to get the API to return the reblog info is to pass that option a string of "true"
.
// Authenticate via API Key
$client = new Tumblr\API\Client('xStJuhp8ZkhqkIrBStSl38kAq4EBRcYizb9ErAKdya5GgFK0WA');
// Make the request
$client->getBlogPosts('isiope.tumblr.com', array('reblog_info' => "true"));
Therefore either the API console needs to be updated to show that you must pass it as a string (a poor fix, IMO) or, ideally, the PHP library needs to be updated to appropriately convert Boolean true
to the value that the underlying Tumblr API expects.
This may also affect the notes_info
argument; I haven't checked. I'm running PHP 5.5.3 (specifically 5.5.3-1ubuntu2.1).
Hello !
Could you please specify which are the steps to use this package on WAMP? Due to guzzle and eher/oauth issue I cannot run script at all...
Thank you !
According to the API docs v2/tagged can be requested with api_key or OAuth. However ... when I try OAuth I always get a "401 Not Authorized" (posting, etc. works).
It would be great if the plugin requirements could meet a newer version for Guzzle.
We're getting so many conflicts because other SDKs require a newer version.
Can you please help me out.. I am not wanting to load all these files onto my shared hosting account. All I want to do is display a simple follower count on my web page. Just a plain text number.. There must be an easier way then loading all these
I have tried a few different things in php, but of course none of them worked..
"KEYHERE", 'consumer_secret' => "KEYHERE" ); $tumblr_followers = $tumblr_API-> get( $tumblr_link, array('limit'=>50)); echo $tumblr_followers; ?>I'm using https://github.com/tumblr/tumblr.php/wiki/Authentication as an example, but when I try to verify auth, by sending POST request to oauth/access_token
I get only curl error: [curl] 56: SSLRead() return error -9806 [url] https://www.tumblr.com/oauth/access_token
Sorry for my bad english..
I can post a single image, but error whit 2 or more image
My code for one image, working code
$data = array(
"type"=> "photo",
"caption"=>"caption test",
"tags"=>"test,prova",
"link"=>"www.google.it",
"data"=>"./nutriA.png");
$client->createPost($blog->name, $data);
code for multiple image, not working code
$path = "./nutriA.png";
$pathb = "./nutriB.png";
$data = array(
"type"=> "photo",
"caption"=>"retest",
"tags"=>"test,prova",
"link"=>"www.google.it",
"data"=>array($path, $pathb));
$client->createPost($blog->name, $data);
output of var_dump($data);
array(5) {
["type"]=>
string(5) "photo"
["caption"]=>
string(6) "retest"
["tags"]=>
string(10) "test,prova"
["link"]=>
string(13) "www.google.it"
["data"]=>
array(2) {
[0]=>
string(12) "./nutriA.png"
[1]=>
string(12) "./nutriB.png"
}
}
error log :
[03-Feb-2015 15:55:43 Europe/Rome] PHP Fatal error: Uncaught exception 'Guzzle\Http\Exception\RequestException' with message 'File must be a string or instance of PostFileInterface' in /home2/panperfo/public_html/rss/tumblr/vendor/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php:226
Stack trace:
#0 /home2/panperfo/public_html/rss/tumblr/vendor/tumblr/tumblr/lib/Tumblr/API/RequestHandler.php(108): Guzzle\Http\Message\EntityEnclosingRequest->addPostFiles(Array)
#1 /home2/panperfo/public_html/rss/tumblr/vendor/tumblr/tumblr/lib/Tumblr/API/Client.php(468): Tumblr\API\RequestHandler->request('POST', 'v2/blog/vetrina...', Array)
#2 /home2/panperfo/public_html/rss/tumblr/vendor/tumblr/tumblr/lib/Tumblr/API/Client.php(407): Tumblr\API\Client->makeRequest('POST', 'v2/blog/vetrina...', Array, false)
#3 /home2/panperfo/public_html/rss/tumblr/vendor/tumblr/tumblr/lib/Tumblr/API/Client.php(228): Tumblr\API\Client->postRequest('v2/blog/vetrina...', Array, false)
#4 /home2/panperfo/public_html/rss/tumblr/tumblr.php(57): Tumblr\API\Client->createPost('vetrinav in /home2/panperfo/public_html/rss/tumblr/vendor/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php on line 226
guzle version 3.9.2 (2014-09-10)
i've tryed various mode od doing the image array, also tryed using source(i know wrong way), always get error
I have been testing the tumblr library on my local site, and everything works as expected. However, on uploading to AWS I get the following error:
Fatal error: Class 'Tumblr\API\Client' not found in /var/app/current/tumblr.php on line 15
With the following code:
can i use php api for send question or fanmail to blogger??
tnk!
I see there's a set token in the Readme but how do you get one? When I tried to do getClientInfo it just came back not authorized.
Ok , so I was able to install the vendor folder and include the autoload.php .. Below is the script is the authentication script, but I get this error Fatal error: Class 'Tumblr\API\Client' not found in /home/content/72/9959172/html/ even though I have the client.php class in the API folder ... what's wrong ?? This has been giving such a hard time and it should be pretty easy ... I read somewhere that it could be due to the fact that it's outdated .. I dont know
require_once('vendor/autoload.php');
// some variables that will be pretttty useful
$consumerKey = 'xxxxxxxxxxxxxx';
$consumerSecret = 'xxxxxxxxxxxxxxxxxx';
$client = new Tumblr\API\Client($consumerKey, $consumerSecret);
$requestHandler = $client->getRequestHandler();
$requestHandler->setBaseUrl('https://www.tumblr.com/');
// start the old gal up
$resp = $requestHandler->request('POST', 'oauth/request_token', array());
// get the oauth_token
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
// tell the user where to go
echo 'https://www.tumblr.com/oauth/authorize?oauth_token=' . $data['oauth_token'];
$client->setToken($data['oauth_token'], $data['oauth_token_secret']);
// get the verifier (will be in URL that the user comes back to)
echo "\noauth_verifier: ";
$handle = fopen('php://stdin', 'r');
$line = fgets($handle);
// exchange the verifier for the keys
$verifier = trim($line);
$resp = $requestHandler->request('POST', 'oauth/access_token', array('oauth_verifier' => $verifier));
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
// and print out our new keys
$token = $data['oauth_token'];
$secret = $data['oauth_token_secret'];
echo "\ntoken: " . $token . "\nsecret: " . $secret;
// and prove we're in the money
$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);
$info = $client->getUserInfo();
echo "\ncongrats " . $info->user->name . "!\n";
Hi, I am facing issues with posting a video to Tumblr to my blog.
I've followed the spec from here - https://www.tumblr.com/docs/en/api/v2
I've gone through the issues and most of them are about sharing photos and I couldn't find one relating to video(Let me know if I've left out anything.)
It's working fine when I use a photo, but fails when I use a video.
$this->client->getRequestHandler()->setBaseUrl(TUMBLR_AUTH_BASEURL);
$this->client->setToken($oauth_token, $oauth_token_secret);
// Tried a remote video using source key(Like the remote photo sharing api)
//$video_path = "http://download.wavetlan.com/SVV/Media/HTTP/MP4/ConvertedFiles/Media-Convert/Unsupported/dw11222.mp4";
$video_path = "twitter_sample.mp4";
$file_contents = file_get_contents($video_path);
if($file_contents !== NULL){
$this->client->getRequesthandler()->setBaseUrl(TUMBLR_BASEURL);
$data = [
"type"=> "video",
"caption" => "posted from API again",
"source" => $video_path
];
syslog(LOG_WARNING, print_r($data, true));
$return_vals = $this->client->getRequesthandler()->request(
"POST",
"v2/blog/".$blog_identifier.".tumblr.com/post",
$data
);
var_dump($return_vals);
return $return_vals;
}
It returns -
object(stdClass)[38]
public 'status' => int 400
public 'body' =>
object(Guzzle\Http\EntityBody)[45]
protected 'contentEncoding' => boolean false
protected 'rewindFunction' => null
protected 'stream' => resource(124, stream)
protected 'size' => null
protected 'cache' =>
array (size=9)
'wrapper_type' => string 'PHP' (length=3)
'stream_type' => string 'TEMP' (length=4)
'mode' => string 'w+b' (length=3)
'unread_bytes' => int 0
'seekable' => boolean true
'uri' => string 'php://temp' (length=10)
'is_local' => boolean true
'is_readable' => boolean true
'is_writable' => boolean true
protected 'customData' =>
array (size=0)
empty
public 'headers' =>
array (size=7)
'Server' =>
array (size=1)
0 => string 'nginx' (length=5)
'Date' =>
array (size=1)
0 => string 'Mon, 22 Feb 2016 12:42:09 GMT' (length=29)
'Content-Type' =>
array (size=1)
0 => string 'application/json; charset=utf-8' (length=31)
'Transfer-Encoding' =>
array (size=1)
0 => string 'chunked' (length=7)
'Connection' =>
array (size=1)
0 => string 'close' (length=5)
'Set-Cookie' =>
array (size=1)
0 => string 'tmgioct=56cb02215321710025097480; expires=Thu, 19-Feb-2026 12:42:09 GMT; Max-Age=315360000; path=/; httponly' (length=108)
'P3P' =>
array (size=1)
0 => string 'CP="Tumblr's privacy policy is available here: https://www.tumblr.com/policy/en/privacy"' (length=88)
The only error returned is 400 and nothing shows up on the blog.
Using createPost()
on this also yields -
Fatal error: Uncaught Tumblr\API\RequestException: [400]: Bad Request (No video data found.) thrown in /exposure-server/src/frontend/vendor/tumblr/tumblr/lib/Tumblr/API/Client.php on line 427
which I guess is the same thing as the previous request.
Is this library not designed for video sharing yet, is there any other way that would work?
When we want to create a tumblr client on JS, it's like that:
var client = tumblr.createClient({
consumer_key: '<consumer key>',
consumer_secret: '<consumer secret>',
token: '<oauth token>',
token_secret: '<oauth token secret>'
});
and in PHP:
$client = new Tumblr\API\Client($consumerKey, $consumerSecret);
$client->setToken($token, $tokenSecret);
Why not to standardize the construct method to be like that one in JS:
// Client.php
/**
* Create a new Client
*
* @param array $options an array of options that the Client support
*/
public function __construct(array $options))
{
$options = array_merge(array(
'consumer_key' => '',
'consumer_secret' => '',
'token' => '',
'token_secret' => '',
), $options);
$this->requestHandler = new RequestHandler();
$this->setConsumer($options['consumer_key'], $options['consumer_secret']);
$this->setToken($options['token'], $options['token_secret']);
}
after this modification, this the way to make a tumblr client in PHP:
$client = new Tumblr\API\Client(array(
'consumer_key' => $consumerKey,
'consumer_secret' => $consumerSecret,
'token' => $token,
'token_secret' => $tokenSecret,
));
Hi. I'm getting an error message that is similar to what was discussed in issue #22, but I'm not able to resolve it and would appreciate any help/feedback as to what I'm doing wrong. Starting with some of the example code in #22, I'm able to retrieve the blog information fine (ex: $info->user->name
), but post creation seems to fail, with the following apache error.log messages:
[Wed Sep 21 12:28:37.327302 2016] [:error] [pid 16206] [client 50.132.230.189:60340] PHP Fatal error: Uncaught Tumblr\\API\\RequestException: [401]: Unauthorized\n\n thrown in /var/www/html/tumblrAPI/vendor/tumblr/tumblr/lib/Tumblr/API/Client.php on line 427
Here's the full code. I've redacted the consumer key, consumer secret, and blogName, but everything else is in tact.
<?php
session_start();
require_once('vendor/autoload.php');
$consumerKey = 'PLACE HERE';
$consumerSecret = 'PLACE HERE';
$blogName = 'PLACE HERE'; // blogname.tumblr.com
$client = new Tumblr\API\Client($consumerKey, $consumerSecret);
$requestHandler = $client->getRequestHandler();
$requestHandler->setBaseUrl('https://www.tumblr.com/');
// If we are visiting the first time
if (!$_GET['oauth_verifier']) {
// grab the oauth token
$resp = $requestHandler->request('POST', 'oauth/request_token', array());
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
// tell the user where to go
echo '<a href="https://www.tumblr.com/oauth/authorize?oauth_token=' . $data['oauth_token'].'"> GO </a>';
$_SESSION['t']=$data['oauth_token'];
$_SESSION['s']=$data['oauth_token_secret'];
} else {
$verifier = $_GET['oauth_verifier'];
// use the stored tokens
$client->setToken($_SESSION['t'], $_SESSION['s']);
// to grab the access tokens
$resp = $requestHandler->request('POST', 'oauth/access_token', array('oauth_verifier' => $verifier));
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
// and print out our new keys we got back
$token = $data['oauth_token'];
$secret = $data['oauth_token_secret'];
echo "token: " . $token . "<br/>secret: " . $secret;
$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);
$info = $client->getUserInfo($blogName);
echo "<br/><br/>congrats " . $info->user->name . "!";
$client3 = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);
$data = array(
'type' => 'link',
'title' => 'title',
'url' => 'http://www.yahoo.com',
'description' => 'my sample tumblr post',
'publisher' => 'me',
'photos' => array(
'width' => '1920',
'height' => '1080',
'url' => 'https://i.ytimg.com/vi/m5d1FlSeF-M/maxresdefault.jpg'
)
);
$post = $client3->createPost($blogName, $data);
echo $post;
}
?>
Hello,
New to all this, so I was to try the provided example in the wiki. I've put my keys into the code and uploaded it to my server (composer handles the actual lib).
When I load up the php file, this is all I get:
https://www.tumblr.com/oauth/authorize?oauth_token=QcA7OnhqO6chX7lfqHUx810cp84DA1wmPLooytAaTybudQEWmv oauth_verifier: token: secret:
Seems like verifier, token and secret are missing?
Hi i wanna ask about this error
"Php fatal error: class 'Tumblr\API\Client' not found in........."
The code:
$client= new Tumblr\API\Client ($consumerKey, $consumerSecret);
$client ->setToken ($token, $tokenSecret);
I had read about this error n tried to do like they said but the code still had this error
Someone please help
Hello, I'm posting on my blog from the api, and I have correctly added the application of tumbrl on my twitter, but nothing is shared of what I post with the api. But if it is shared if I create a post directly from the panel
$data = array(
"type"=>"photo",
"caption"=>$CAP,
"link"=>$LNK,
"source"=>$IMG,
"tags"=>Tags(),
"tweet"=>$CAP. " [URL]",
);
$NM = $client->createPost($B1, $data);
Hi,
I can post a photo with $client->createPost($blogName, $data);
$data = array();
$data['type'] = "photo";
$data['tags'] = "foo, bar";
$data['source'] = "/path/to/mypicture.jpg";
but how to do this with a photosets ?
Since I didn't get a reply to my comment on #27... :P Somehow d79576f didn't get put in master. Interestingly seejohnrun/tumblr.php@d79576f looks perfectly fine. I'm guessing some weird stuff related to moving the repo over to the tumblr org.
So I've managed to get things up and running, finally. But now I'm wondering about persistence. What would be the ideal solution of storing the given access token for later use? I don't want the visitors to have to go through the entire flow with authorization upon every interaction.
I thought the idea was that if the user already has authorized and gotten a access token, it would redirect directly through the callback, skipping the tumblr authorization screen.
How is the flow supposed to work? Been googling like crazy.
connect.php
session_start();
require_once('../vendor/autoload.php');
// some variables that will be pretttty useful
$consumerKey = 'xxx';
$consumerSecret = 'xxx';
$client = new Tumblr\API\Client($consumerKey, $consumerSecret);
$requestHandler = $client->getRequestHandler();
$requestHandler->setBaseUrl('https://www.tumblr.com/');
// start the old gal up
$resp = $requestHandler->request('POST', 'oauth/request_token', array());
// get the oauth_token
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
$_SESSION['request_token'] = $data['oauth_token'];
$_SESSION['request_token_secret'] = $data['oauth_token_secret'];
if($data['oauth_callback_confirmed']) {
// redirect
$url = 'https://www.tumblr.com/oauth/authorize?oauth_token=' . $data['oauth_token'];
header('Location: '.$url);
} else {
echo 'Could not connect to Tumblr. Refresh the page or try again later.';
}
exit();
callback.php
session_start();
require_once('../vendor/autoload.php');
// some variables that will be pretttty useful
$consumerKey = 'xxx';
$consumerSecret = 'xxx';
$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $_SESSION['request_token'], $_SESSION['request_token_secret']);
$requestHandler = $client->getRequestHandler();
$requestHandler->setBaseUrl('https://www.tumblr.com/');
unset($_SESSION['request_token']);
unset($_SESSION['request_token_secret']);
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$verifier = $_GET['oauth_verifier'];
$resp = $requestHandler->request('POST', 'oauth/access_token', array('oauth_verifier' => $verifier));
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
// and print out our new keys
$token = $data['oauth_token'];
$secret = $data['oauth_token_secret'];
echo "\ntoken: " . $token . "\nsecret: " . $secret;
// and prove we're in the money
$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);
$info = $client->getUserInfo();
There are endpoints that this api does not cover, i would like to call the endpoints my self but the getRequest and postRequest methods are private.
Sorry if this is the wrong place, this is my first time.
I'm using the code your offered in this issue, as I was getting the same problem: #22
However, the suggested code returns Undefined index: oauth_verifier
? I have composer up and running, etc. Would anyone know why this is?
So I've been able to authenticate through Tumblr's API using PHP
So I've used this method to create a post to my blog on Tumblr via the API but I get the error below
Fatal error: Cannot unset string offsets in
/home/content/72/9959172/html/mysite/Tumblr/lib/Tumblr/API/RequestHandler.php on line 85
and below is my code .. I used the method suggested on github to create a post
if(isset($_POST['data'])){
$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $_SESSION ['token'], $_SESSION ['secret']);
$client->createPost($_SESSION ['blog_name'], $_POST['data']);
}
?>
Hi,
i want to know how to change the original caption of a post when reblogging it.
With the API, the original caption are still present when reblogging, however when reblogging on tumblr, we can change it in the editor...
How to archive this ?
thanks
I want to know how to achieve login flow to get token and token secret so users can get results related to their token. please be specific about code because i am beginner.. thanks
I have used composer to install (see below), which works fine on my localhost. But after deploying it on an Amazon Web Services PHP server, it throws the error: "Fatal error: Class 'Tumblr\API\Client' not found".
Any thoughts?
Thanks!
{
"require": {
"tumblr/tumblr": "dev-master"
}
}
Hi, i´m using oauth as found in https://github.com/tumblr/tumblr.php/wiki/Authentication
But i´m getting
"Fatal error: Uncaught Tumblr\API\RequestException: [401]: Not Authorized thrown in ../tumblr/lib/Tumblr/API/Client.php on line 427"
can you help me ?
Thanks in advance,
Gonçalo
require_once('vendor/autoload.php');
// some variables that will be pretttty useful
$consumerKey = 'XXX';
$consumerSecret = 'YYY';
// some variables that will be pretttty useful
$client = new Tumblr\API\Client($consumerKey, $consumerSecret);
$requestHandler = $client->getRequestHandler();
$requestHandler->setBaseUrl('https://www.tumblr.com/');
//IF Receive oauth
if(!$_GET['oauth_verifier']){
// start the old gal up
$resp = $requestHandler->request('POST', 'oauth/request_token', array());
// get the oauth_token
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
// tell the user where to go
echo '<a href="https://www.tumblr.com/oauth/authorize?oauth_token=' . $data['oauth_token'].'"> GO </a>';
$client->setToken($data['oauth_token'], $data['oauth_token_secret']);
$_SESSION['t']=$data['oauth_token'];
$_SESSION['s']=$data['oauth_token_secret'];
} else {//IF i don´t Receive oauth
// get the verifier (will be in URL that the user comes back to)
echo "\noauth_verifier: ";
$handle = fopen('php://stdin', 'r');
$line = fgets($handle);
// exchange the verifier for the keys
$verifier = trim($line);
$verifier = $_GET['oauth_verifier'];
$token = $_SESSION['t'];
$secret = $_SESSION['s'];
//FROM tumblrPHP
$resp = $requestHandler->request('POST', 'oauth/access_token', array('oauth_verifier' => $verifier));
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);
// and print out our new keys
$token = $_SESSION['t'];
$secret = $_SESSION['s'];
echo "\ntoken: " . $token . "\nsecret: " . $secret;
// and prove we're in the money
$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);
$info = $client->getUserInfo();
echo "\ncongrats " . $info->user->name . "!\n";
}
When I use Yahoo Tumblr iOS SDK to share, my post on Tumblr displays a link to the app:
Is there a way to do this with the PHP SDK?
I am trying since hours, I don't get it why the verifier does not work.
Appreciate any help.
CODE: $consumerKey = '****'; $consumerSecret = '****'; $client = new Tumblr\API\Client($consumerKey, $consumerSecret); $requestHandler = $client->getRequestHandler(); $requestHandler->setBaseUrl('https://www.tumblr.com/'); // start the old gal up $resp = $requestHandler->request('POST', 'oauth/request_token', array()); // get the oauth_token $out = $result = $resp->body; $data = array(); parse_str($out, $data); echo 'RESPONSE '; print_r($out); echo '';echo '
data '; print_r($data); echo '';$_SESSION["secretword"] = $data['oauth_token'];
$_SESSION["theme"] = $data['oauth_token_secret'];echo 'https://www.tumblr.com/oauth/authorize?oauth_token=' . $data['oauth_token'];
$client->setToken($data['oauth_token'], $data['oauth_token_secret']);// get the verifier (will be in URL that the user comes back to)
// echo "
oauth_verifier: " . $verifier;
// $handle = fopen('php://stdin', 'r');
// $line = fgets($handle);// exchange the verifier for the keys
$verifier = $_GET["oauth_verifier"];echo '
next verifier: ' . $verifier;$resp = $requestHandler->request('POST', 'oauth/access_token', array('oauth_verifier' => $_GET['oauth_verifier']));
$out = $result = $resp->body;
$data = array();
parse_str($out, $data);echo '
OUT '; print_r($out); echo '';
echo 'DATA '; print_r($data); echo '';// and print out our new keys
$token = $data['oauth_token'];
$secret = $data['oauth_token_secret'];
echo "
token: " . $token . "
secret: " . $secret;// and prove we're in the money
$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);
$info = $client->getUserInfo();
echo "\ncongrats " . $info->user->name . "!\n";echo $consumerSecret, '
';
echo $token, '
';
echo $dataecret, '
';echo $client->getBlogInfo($blogName);
RESPONSE: RESPONSE Guzzle\Http\EntityBody Object ( [contentEncoding:protected] => [rewindFunction:protected] => [stream:protected] => Resource id #25 [size:protected] => [cache:protected] => Array ( [wrapper_type] => PHP [stream_type] => TEMP [mode] => w+b [unread_bytes] => 0 [seekable] => 1 [uri] => php://temp [is_local] => 1 [is_readable] => 1 [is_writable] => 1 ) [customData:protected] => Array ( [default] => 1 ) ) data Array ( [oauth_token] => 9vkc8pnG1Hzyxs3pVkqbiQ57UvknvQJFCwCTilZHpvLvU5u8I6 [oauth_token_secret] => 7XoNTknw0U5Iolwx1M1AuVe2lb036RTa6S6XVhwlxyjPxL7A5m [oauth_callback_confirmed] => true ) https://www.tumblr.com/oauth/authorize?oauth_token=9vkc8pnG1Hzyxs3pVkqbiQ57UvknvQJFCwCTilZHpvLvU5u8I6 oauth_verifier: next verifier: do2pDHzPzgaJjMpKGUMBqlz1sRY9Rbngz1OPZsz9pEYg0yPSiZ OUT Guzzle\Http\EntityBody Object ( [contentEncoding:protected] => [rewindFunction:protected] => [stream:protected] => Resource id #29 [size:protected] => [cache:protected] => Array ( [wrapper_type] => PHP [stream_type] => TEMP [mode] => w+b [unread_bytes] => 0 [seekable] => 1 [uri] => php://temp [is_local] => 1 [is_readable] => 1 [is_writable] => 1 ) [customData:protected] => Array ( ) ) DATA Array ( [Missing_or_invalid_oauth_verifier_] => ) token: secret:
Hey tumblr,
Could you explain the "basic usage" a little bit more?
eg: 'The first step is setting up a Client:'
In what file should we add this? Create an index.php ? and include all other files or?
I'm a little bit confused.
Thanks for replying
The type parameter passed to to an request for post, causes that the 'post' response was a empty array
Hi.
I would like to know if there a way to get all the post of a blog by the RSS feed (paginated RSS ?)
thanks
--- fck, wrong repo, sorry ---
Hi.
I would like to know if there a way to remove "reblog comments" of a post when reblogging through the API, like it's possible on the Tumblr web interface.
thanks
Hi,
I am not using the tokens just the consumer key and consumer secret
$consumerKey = 'xxx';
$consumerSecret = 'yyy';
$client = new Tumblr\API\Client($consumerKey, $consumerSecret);
$tag='my tag';
$options = array('limit'=>20);
but it only gets the last 3 posts.
Help please!
$taggedPosts = $client->getTaggedPosts($tag,$options);
update:
when I set the limit to 6 I get 5 posts. when I set it to any larger number I get 3 posts.
???
Hello There,
I have run composer dependencies within API folder of tumblr.Please let me know that where the file for creating client object will be place.
Where should we place this code:-
$client = new Tumblr\API\Client($consumerKey, $consumerSecret);
$client->setToken($token, $tokenSecret);
I have placed it inside API folder . And it says client class not found
Regards
Ashish
I am able to upload one image to a "photo" post by passing the file name to "data". but the client complains when I made "data" into an array of strings. Is this supported? how should I do it?
--- There are the error message:
Unhandled Exception
Message:
File must be a string or instance of PostFileInterface
Location:
/home/ubuntu/myProject/laravel/application/libraries/Guzzle/Http/Message/EntityEnclosingRequest.php on line 227
--- Here's my code
$client = new Tumblr\API\Client( $consumer_key, $consumer_secret,
$oauth_key, $oauth_secret);
//$image_array = "/home/ubuntu/Downloads/Cool-Background-Pictures-For-Computer.jpg"; // This works
$image_array = array("/home/ubuntu/Downloads/Cool-Background-Pictures-For-Computer.jpg", "/home/ubuntu/Downloads/Cool-Background-Pictures-For-Computer.jpg") ; // Doesn't work!
$data = array("type"=> "photo", "caption"=>"caption test2", "data"=> $image_array);
$client->createPost($blogName, $data);
I'm try to do a POST request on oauth/request_token but it suddenly it returns a 401 Http status.
Here's my code
$client = new Client(<consumerKey>, <consumerSecret>);
$client->requestHandle->setBaseUrl('http://www.tumblr.com/');
$results = $client->requestHandler->request('POST', 'oauth/request_token', [
'oauth_callback' => 'http://callback.com',
]);
print_r($results);
The status field now returns 401 status. We just encountered this error now because 2 days ago it was still working.
Is there any problems on my side or is this the problem of Tumblr API?
title says all
can you show a pagination example usage please ?
I know this isn't quite an issue, but I was wondering if someone could supply a working demo or example page. Basically we supply our Consumer Key and Secret and it will allow us to login using tumblr.
Thank you if someone chooses to do this. If not can you explain why or someplace to see a working demo such as this?
Hi,
I try to:
echo json_encode($this->client->like($_POST["id"], $_POST["reblogKey"]));
it's success (I checked my account in tumblr) but in return I get []
How I can be sure that the "Like" indeed manage?
Best,
MIchael
I get this error Fatal error: Class 'Eher\OAuth\HmacSha1' not found in, I tried to install Eher folder data on windows , but for some reason I have an issue with the php_imagick.dll when I run the command curl -sS https://getcomposer.org/installer | php
php composer.phar install --no-dev
Is there any way I can install both the Eher and Tumblr PHP files alltogether manually ? and can you explain me the hierarchy of the Tumblr Folder and the Eher , because I installed the Tumblr Foler in my FTP (Tumblr/API/Client.php,RequestException.php,RequestHandler.php) and then I installed the Eher folder in the API folder .. which i thought would work , but it's still giving me those errors ... Any help regarding this issue would be greatly appreciated.... If there's a way I can install both the Tumblr and Eher folders alltogether to avoid these path errors , that'd be great.
Hi, i just wan to know why the tumblr API is so slow
To get the last 20 post of a blog, it take approximatively 800ms...
Hi,
I want to know if it's possible to reblog a post with a custom slug throw Tumblr php API.
Actually i use this without success
''''
$client->reblogPost((string)$blog, $postID, (string)$reblogKey,array('comment' => $comment,'tags'=>$tags,'state'=>$state,'slug' =>(string)$slug));
''''
thanks you
Hi.
I'm trying to edit a post by changing the comment. But this doesn't work...
I can succesfully change the tags, or add comments when i reblog or edit a post.
But can edit comment on an edit action.
Is this possible to edit the comment of a particular post ?
thanks
i got this error when i run my file
my code is here
'; // Retrieve User Info $user_info = $client->getUserInfo(); print_r($user_info); foreach ($client->getUserInfo()->user->blogs as $blog) { print_r($blog); echo $blog->name . "\n"; } ?>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.