My favorites | Sign in
Project Logo
             
Search
for
Updated May 09, 2009 by my.name.is.saymonz
Labels: Featured, Phase-Implementation
Documentation  
It's easy, I promise :) .

Read functions

Here are docs for all the read functions. It's soooo easy to read the informations from a tumblelog uning phpTumblr that I think a doc is useless... But here it is!

Creating the object

So, at first, you have to create the readTumblr object. That simple:

$tumblrObj = new readTumblr('mytumblelog');

Where mytumblelog is the ID of your tlog on Tumblr (the part before tumblr.com in it's URI).

Get some posts

Now, the main function of phpTumblr: getPosts. You can get posts with many parameters. You want your 10 last videos? Your 3 last audios starting from the 15th ? No problem :) .

Here's the syntax:

$tumblrObj->getPosts($start,$num,$type,$id);

Let's see the params:

And finally get it!

No more ceremony...

$tumblrArr = $tumblrObj->getArray();

Now I think you could print_r that array and see what you can do with it ;) . That's all!

Enable Caching

phpTumblr support caching of XML files to save bandwith. It's simple as well! Remember when we create the Object?

$tumblrObj = new readTumblr('mytumblelog');

Just create a readTumblrCache object!

$tumblrObj = new readTumblrCache('mytumblelog','path/to/tmp',3600);

The first param have not changed. The second is the path to you cache directory. Be sure you webserver can write in! The last param is the time in second before refreshing the cache. 3600s = 1h. But you can put whatever you want ;) .


Comment by applecat69, Dec 23, 2008

great work!thanks for teaching

Comment by jason.conklin, May 16, 2009

Just thought I'd point out that this documentation doesn't quite work with the updated package. The comments in the example files included with the download explain everything, though!

Comment by my.name.is.saymonz, May 17, 2009

Yeah, I've didn't updated here yet... But the example.php is hopefully clear enough.

Comment by timani27, Jun 17, 2009

bless your soul! Kind sir!!!!


Sign in to add a comment
Hosted by Google Code