PHP code example of matheusmariano / tumblr

1. Go to this page and download the library: Download matheusmariano/tumblr library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

matheusmariano / tumblr example snippets

 php
$auth = new ApiKey('your-consumer-key');
 php
$auth = new OAuth; // Also accepts ordered parameters.
$auth->consumerKey = '...';
$auth->consumerSecret = '...';
$auth->oauthToken = '...';
$auth->oauthTokenSecret = '...';
 php
['oauth_token' => '...', 'oauth_token_secret' => '...']
 php
$oauthVerifier = $_GET['oauth_verifier'];
 php
$client = new Client($auth);
 php
$object = $client->get('blog/nutright.tumblr.com/posts/text', [
    'api_key' => true,
    'tag' => 'fruit',
]);
 php
$object->total_posts; // int
$object->posts; // array
$object->blog; // stdClass
$object->blog->title; // string
 php
try {
    $client->get('blog/nutright.tumblr.com/followers', ['api_key' => true]);
} catch (\GuzzleHttp\Exception\ClientException $e) {
    // Do something
}