Created
October 24, 2013 00:16
-
-
Save jelled/7129104 to your computer and use it in GitHub Desktop.
New tumblr post using the tumblr.php library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Quick Setup | |
$ git clone https://github.com/tumblr/tumblr.php.git | |
$ cd tumblr.php | |
$ composer install | |
*/ | |
require_once('vendor/autoload.php'); | |
//Your application keys generated at http://www.tumblr.com/oauth/apps | |
$consumerKey = 'CONSUMER_KEY'; | |
$consumerSecret = 'CONSUMER_SECRET'; | |
//Your user's keys | |
$token = 'USER_TOKEN'; | |
$tokenSecret = 'USER_TOKEN_SECRET'; | |
$blogName = 'jelled'; | |
$data = array( | |
"type" => "text", | |
"title" => "Test post from the Tumblr API", | |
"body" => "This body don't quit" | |
); | |
$client = new Tumblr\API\Client($consumerKey, $consumerSecret); | |
$client->setToken($token, $tokenSecret); | |
$client->createPost($blogName, $data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment