This is a very basic interface for the Tumblr API to enable you to read posts.
Install the bundle
$ php artisan bundle:install tumblr
Include it in application/bundles.php
return array('tumblr');
In application/routes.php you can add a simple route to read and dump your tumblr posts at /tumblr
Route::get('tumblr', function()
{
Bundle::start('tumblr');
$posts = Tumblr\Tumblr::init('benedmunds')->skip(0)->take(10)->all();
var_dump($posts);
});
/**
* Init and set the username
*
* @param string username
* @return object
*/
$tumblr = Tumblr\Tumblr::init('benedmunds');
/**
* set the results to skip (offset)
*
* @param integer skip offset
* @return object
*/
$tumblr = Tumblr\Tumblr::init('benedmunds')->skip(0);
/**
* set the results to take (limit)
*
* @param integer take limit
* @return object
*/
$tumblr = Tumblr\Tumblr::init('benedmunds')->skip(0)->limit(10);
/**
* Reset the skip and take
*/
$tumblr = Tumblr\Tumblr::init('benedmunds')->skip(0)->limit(10);
$tumblr->clear()->all();
/**
* Get all of the posts
*
* @return integer number of posts
*/
$tumblr = Tumblr\Tumblr::init('benedmunds')->skip(0)->limit(10)->all();
/**
* Count all of the posts
*
* @return array posts
*/
$tumblr = Tumblr\Tumblr::init('benedmunds')->count();
/**
* Get a post
*
* @param integer post id
* @return array post
*/
$tumblr = Tumblr\Tumblr::init('benedmunds')->get(1);
Bundle created by Ben Edmunds.
You can install this bundle by running the following CLI command:
php artisan bundle:install tumblr
Alternatively you can download it directly from GitHub:
http://github.com/benedmunds/Laravel-Tumblr