I have VIMEO PRO account and its very difficult sometimes to copy paste videos titles and URLs to my website. I was trying to figure out a way to extract the video information from vimeo and get the list of all my videos under my vimeo channel. If you would like to achieve same functionality you can follow the following steps:
STEP # 1: CREATE AN ALBUM IN YOUR VIMEO ACCOUNT AND ORGANIZE ALL VIDEOS IN YOUR ALBUM
- Go to https://vimeo.com/organizer/collections
- Under organizer > Create new album and organize all videos in the newly created album
- Get Album ID and save it (if you don’t know how to get album ID you can following instruction here -https://forum.livebooks.com/livebooks/topics/what_is_my_vimeo_album_id)
STEP # 2: DOWNLOAD AND UPLOAD VIMEO ADVANCE PHP API LIBRARY ON YOUR HOSTING
- Download PHP API Library: https://developer.vimeo.com/apis/advanced#libraries
- From that zip, upload “vimeo.php” and “index.php” to a folder called “vimeo” on the root of your website
- Create a folder within “vimeo” called “cache” with permissions 777.
- URL will be: www.YOURWEBSITE.com/vimeo/
STEP # 3: REGISTER YOUR WEB SITE AS AN API APPLICATION ON VIMEO
- Login to your vimeo account, and register your website as a new “app” at http://www.vimeo.com/api/applications/new
- Use the URL of your website as the “Application URL”. IMPORTANT: Enter the URL to the index.php you just uploaded as the “Application Callback URL”. (In my example, this would be http://www.YOURWEBSITE.com/vimeo/index.php)
- If it’s your first time registering an app, you MAY have to wait for a human interaction to authorize the request.
- Get your Consumer Key and Consumer Secret
- Get YourOAuthAccessToken and YourOAuthAccessTokenSecret
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?php require_once('vimeo.php'); $vimeo = new phpVimeo('ConsumerKey', 'ConsumerSecret'); $vimeo->setToken('YourOAuthAccessToken', 'YourOAuthAccessTokenSecret'); $albumID = 'YOUR_ALBUM_ID'; for ($x = 0; $x <= 17; $x++) { //x is the number of album pages you would like to retrieve echo "<table><tr><th>Video Title</th><th>Vimeo URL</th></tr>"; $result = $vimeo->call('vimeo.albums.getVideos', array( //Reference: https://developer.vimeo.com/apis/advanced/methods/vimeo.albums.getVideos 'album_id' => $albumID, 'page' => $x, 'per_page' => '50', full_response => '1' )); $videos = $result->videos->video; foreach ($videos as $video) { echo "<tr><td>" . $video->title . "</td><td>" . $video->urls->url[0]->_content . "</td></tr>"; } echo '</table>'; } ?> |