Skip to content

Instantly share code, notes, and snippets.

@hanksudo
Created May 16, 2011 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanksudo/3f3a66e1c4c802d8b64a to your computer and use it in GitHub Desktop.
Save hanksudo/3f3a66e1c4c802d8b64a to your computer and use it in GitHub Desktop.
Get Vimeo source url
function vimeoid2url($id) {
$xmlurl = "http://www.vimeo.com/moogaloop/load/clip:{$id}";
$videoxml = file_get_contents($xmlurl);
preg_match('|<request_signature>(.*)</request_signature>|i',$videoxml,$sig);
preg_match('|<request_signature_expires>(.*)</request_signature_expires>|i',$videoxml,$sigexp);
$url = "http://www.vimeo.com/moogaloop/play/clip:{$id}/{$sig[1]}/{$sigexp[1]}/?q=sd";
return $url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment