Skip to content

Instantly share code, notes, and snippets.

@freddiefujiwara
Created March 15, 2009 14:45
Show Gist options
  • Save freddiefujiwara/79434 to your computer and use it in GitHub Desktop.
Save freddiefujiwara/79434 to your computer and use it in GitHub Desktop.
var a = document.getElementsByTagName('a'),directs=[];
function ypipesCallBack(data){
var d=eval("("+data.value.items[0].description+")");
for(var i = 0 ; i < a.length; i++){
if(a[i].target="veoh" && a[i].href=="http://www.veoh.com/videos/"+d.videoId){
a[i].href="http://www.veoh.com/iphone/#_Browse/rel/srch/all/0/"+d.title;
break;
}
}
}
if(RegExp(" AppleWebKit/").test(navigator.userAgent) && RegExp(" Mobile/").test(navigator.userAgent)){
for(var i = 0 ; i < a.length; i++){
if(a[i].target="veoh" && a[i].href.match(/^http:\/\/www.veoh.com\/videos/)){
var s=document.createElement('script');
s.src='http://pipes.yahoo.com/pipes/pipe.run?_id=3i5KJmQR3hGJnFKlBRNMsA&_render=json&_callback=ypipesCallBack&id=';
s.src+=a[i].href.replace(/^http:\/\/www.veoh.com\/videos\//,'');
document.body.appendChild(s);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment