php - getting vimeo id codes from album -


trying call array of videos vimeo album. using vimeo's js api.

https://developer.vimeo.com/apis/simple#album-request

so doc above says access information vimeo album form url this:

http://vimeo.com/api/v2/album/album_id/request.output

and in case url looks this:

$id2 = $_post['alb1']

http://vimeo.com/api/v2/album/$id2/info.php

so everone says use curl read .php file vimeo provides using above url.

from it, need aquire total number of videos in album.

with number need create loop accesses videos (for long album is) , saves array full of video urls.

that saved sql database , database read out in loop print out <li>lines image of video in it.

see in non action here:

http://s199881165.onlinehome.us/transfem/newlayout/getal.php

here's php use read vimeo file

function getvimeoinfo($id, $info)  {      if (!function_exists('curl_init')) die('curl not installed!');     $ch = curl_init();     curl_setopt($ch, curlopt_url, "http://vimeo.com/api/v2/album/$id/videos.php");     curl_setopt($ch, curlopt_header, 0);     curl_setopt($ch, curlopt_returntransfer, true);     curl_setopt($ch, curlopt_timeout, 10);     $output = unserialize(curl_exec($ch));     $output = $output[0][$info];     curl_close($ch);                     return $output;                               }   function getvimeoinfo2($id2, $info2)  {      if (!function_exists('curl_init')) die('curl not installed!');     $ch2 = curl_init();     curl_setopt($ch2, curlopt_url, "http://vimeo.com/api/v2/album/$id2/info.php");     curl_setopt($ch2, curlopt_header, 0);     curl_setopt($ch2, curlopt_returntransfer, true);     curl_setopt($ch2, curlopt_timeout, 10);     $output2 = unserialize(curl_exec($ch2));     $output2 = $output2[0][$info2];     curl_close($ch2);                    return $output2;                                  } 

here other part:

    $thetoatslotzes = getvimeoinfo2($posty_alby,'total_videos');     echo "<script> alert('lotze: " . $thetoatslotzes . "');</script>" ;        $albarray =     getvimeoinfo($_post['alb1'],'url');     echo "<script> alert('albarray: " . $thetoatslotzes . "');</script>" ;           $dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception);        $dbh->begintransaction();        $dbh->exec("truncate table vim_playlist12");                 $dbh->commit();         $i = 0;        while($i < 9) {       $eye_matee =  $i + 1;         $dbh->begintransaction();        $dbh->exec("insert vim_playlist12 (url, listnum) values        ($albarray[$i], $eye_matee)");        $i = $i + 1;           $dbh->commit();       }            $seleccion = 'select url, listnum vim_playlist12 order listnum'; foreach ($dbh->query($seleccion) $row) {     print $row['listnum'] . ": " . $row['url'] . "<br>" ;  }      }      catch (exception $e) {       $dbh->rollback();       echo "failed: " . $e->getmessage();     }  } else  {} 

so if can array of urls vimeo videos.php i'll in shape.


Comments