Created
May 16, 2011 10:21
-
-
Save hanksudo/3f3a66e1c4c802d8b64a to your computer and use it in GitHub Desktop.
Get Vimeo source url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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