protected function __apiRead($aParams = array()) { $sRequest = ''; foreach ($aParams as $k => $v) { $sRequest .= $k.'-'.$v.' '; } $this->__putLog('Requesting '.$this->sTumblrID.'.'.$sRequest); if (!$this->__cacheRead($aParams)) { parent::__apiRead($aParams); $this->__cacheWrite($aParams); } return true; }
# ***** END LICENSE BLOCK ***** /* Execution time counter */ $nStartTime = microtime(true); /* First, you have to include some files : / * The Clearbricks _common.php file / * The Tumblr class itself /*/ require dirname(__FILE__) . '/clearbricks/_common.php'; require dirname(__FILE__) . '/class.read.tumblr.php'; /* Now you can initiate the Tumblr object with the ID of the Tumblelog you want read from as param. / / function __construct($sTumblrID = null,$sHTTPUserAgent = 'phpTumblr') / * Initialize the Tumblr object, take a Tumblr ID as param. / * Optionally take a second param, a string that will be the HTTP User Agent used for the requests made to the API. /*/ $oTumblr = new readTumblr('jiuningzhong'); /* Now, it's time to do some requests from this API. This code will request, in the order: / * 3 video posts / * All regular posts / * The posts with the ID 39185133 / / function getPosts($nStart = 0,$mNum = 20,$sType = null,$nID = null) / * Request $mNum $sType posts starting from $nStart. / * Take posts of all types if $sType = null. / / OR / * If $mNum = 'all', get all $sType posts starting from $nStart / * Take posts of all types if $sType = null. / / OR / * If $nID is given, request the post with the ID $nID.
$nStartTime = microtime(true); /* First, you have to include some files : / * The Clearbricks _common.php file / * The Tumblr class itself /*/ require dirname(__FILE__).'/clearbricks/_common.php'; require dirname(__FILE__).'/class.read.tumblr.php'; /* Now you can initiate the Tumblr object with the ID of the Tumblelog you want read from as param. / / function __construct($sTumblrID = null,$sHTTPUserAgent = 'phpTumblr') / * Initialize the Tumblr object, take a Tumblr ID as param. / * Optionally take a second param, a string that will be the HTTP User Agent used for the requests made to the API. /*/ $oTumblr = new readTumblr('saymonz'); /* Now, it's time to do some requests from this API. This code will request, in the order: / * 3 video posts / * All regular posts / * The posts with the ID 39185133 / / function getPosts($nStart = 0,$mNum = 20,$sType = null,$nID = null) / * Request $mNum $sType posts starting from $nStart. / * Take posts of all types if $sType = null. / / OR / * If $mNum = 'all', get all $sType posts starting from $nStart / * Take posts of all types if $sType = null. / / OR