From 8f5664931cae4c112127a28492ba2fb99cfed12b Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 8 Jan 2009 19:31:55 -0500 Subject: [PATCH] Update example code to pass the http_client and cache object --- framework/Service_Vimeo/doc/vimeo_example.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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; -- 2.11.0