From: Michael J. Rubinsky Date: Fri, 9 Jan 2009 00:31:55 +0000 (-0500) Subject: Update example code to pass the http_client and cache object X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8f5664931cae4c112127a28492ba2fb99cfed12b;p=horde.git Update example code to pass the http_client and cache object --- diff --git a/framework/Service_Vimeo/doc/vimeo_example.php b/framework/Service_Vimeo/doc/vimeo_example.php index d23670558..de0be924b 100644 --- a/framework/Service_Vimeo/doc/vimeo_example.php +++ b/framework/Service_Vimeo/doc/vimeo_example.php @@ -1,6 +1,14 @@ new Horde_Http_Client(), + 'cache' => $GLOBALS['cache'], + 'cache_lifetime' => $GLOBALS['conf']['cache']['default_lifetime']); + +$v = Horde_Service_Vimeo::factory('Simple', $params); + // Get the list of all user videos $results = unserialize($v->user('user1015172')->clips()->run()); @@ -14,9 +22,10 @@ $results = unserialize($v->channel('theedit')->clips()->run()); // List of clips in an album $results = unserialize($v->album('52803')->clips()->run()); -// Get first video to embed +// Get first video to embed - this returns a json encoded array $embed = $v->getEmbedJson($latest['url']); -// Decode the data and print out the HTML +// Decode the data and print out the HTML. You could also just output +// the json within your page's javascript for use later etc... $results = Horde_Serialize::unserialize($embed, SERIALIZE_JSON); echo $results->html;