Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('vimeo.php');
- session_start();
- // Curl helper function
- function curl_get($url) {
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_TIMEOUT, 30);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
- $return = curl_exec($curl);
- curl_close($curl);
- return $return;
- }
- // Create the object and enable caching
- $vimeo = new phpVimeo('KEY SAVED', 'KEY SAVED');
- $vimeo->setToken('KEY SAVED','KEY SAVED');
- $vimeo->enableCache(phpVimeo::CACHE_FILE, './cache', 300);
- $videos = $vimeo->call('vimeo.videos.getAll', array('format' => 'xml', 'sort' => 'newest', 'full_response' => '1', 'summary_response' => '1'));
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>Vimeo Advanced API OAuth Example</title>
- </head>
- <body>
- <h1>Vimeo Advanced API OAuth Example</h1>
- <?php
- //$vars = get_defined_vars();
- //print_r($vars);
- error_reporting(E_ALL);
- $ch = curl_init($videos);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $xml = curl_exec($ch);
- print strlen($xml)." bytes received.\n";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement