compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (52)

View Page History

||Creating New Posts||
{composition-setup}
{deck:id=Usecases}
{card:label=Text Post}
{code:php}
{code:php|title="Text Post"}
//new text post
$post = $tumblr->createNewPost('text'); //also called "regular" post on Tumblr
$post->save();
{code}
{card}

{card:label=Photo Post}
{code:php}
{code:php|title="Photo Post"}
//new photo post by source
$photoPost = $tumblr->createNewPost('photo');
$photoPost->save();
{code}
{card}

{card:label=Quote Post}
{code:php}
{code:php|title="Quote Post"}
//new quote post
$quotePost = $tumblr->createNewPost('quote');
$quotePost->save();
{code}
{card}

{card:label=Link Post}
{code:php}
{code:php|title="Link Post"}
//new link post
$linkPost = $tumblr->createNewPost('link');
$linkPost->save();
{code}
{card}

{card:label=Conversation Post}
{code:php}
{code:php|title="Conversation Post"}
//new conversation post
$conversationPost = $tumblr->createNewPost('conversation');
$conversationPost->setTitle('NYC Directions'); //optional
$conversationPost->save();
{code}
{card}

{card:label=Video Post}
{code:php}
{code:php|title="Video Post"}
//new video post (embed)
$videoPost = $tumblr->createNewPost('video');
$videoPost->save(); //uploads video
{code}
{card}

{card:label=Audio Post}
{code:php}
{code:php|title="Audio Post"}
//new audio post
$audioPost = $tumblr->createNewPost('audio');
$audioPost->save(); //uploads file
{code}
{card}

{card:label=Optional Methods}
{code:php}
{code:php|title="Optional Methods"}
//optional methods - applies to every type of post
$post->setGenerator('Zend_Service_Tumblr');

{code}
{card}

{deck}

||Modifying Posts||
{deck:id=modifyingUseCases}
{card:label=Edit Text Post}
{code:php}
{code:php|title="Edit Text Post"}
$post = $tumblr->editPost('text');
//set the id of the post you want to edit. This is essentially the same as making a new post just this replaces insteads of creating a new post
$post->setBody('Modified Body'); //HTML allowed
{code}
{card}

{card:label=Delete Post}
{code:php}
{code:php|title="Delete Post"}
$tumblr->deletePost('123456');
{code}
{card}

{deck}

||Authentication||
{deck:id=authenticationUseCases}

{card:label=Retrieving user attributes}
{code:php}
{code:php|title="Retrieving user attributes"}
$user = $tumblr->getUser();
$user->canUploadAudio();
$user->getMaxVideoBytesUploaded();
{code}
{card}

{card:label=Retrieving tumblelog attributes}
{code:php}
{code:php|title="Retrieving tumblelog attributes"}
$tumblelogs = $tumblr->getMyTumblelogs();
foreach($tumblelogs as $log){
}
{code}
{card}

{deck}

||Reading Posts||
{deck:id=readingPostUseCases}

{card:label=Get Posts}
{code:php}
{code:php|title="Get Posts"}
/**
* Does not require authentication
}
{code}
{card}

{card:label=Get Posts with optional paramaters}
{code:php}
{code:php|title="Get Posts with optional paramaters"}
/**
* Full List of optional paramaters
$posts = $tumblr->getPosts('tumblraddress.tumblr.com', $params);
{code}
{card}

{card:label=Get Tumblelog}
{code:php}
{code:php|title="Get Tumblelog"}
/**
* Does not require authentication necessarily, but limited to certain data
}
{code}
{card}


{deck}

{zone-data}