Created
March 15, 2009 14:45
-
-
Save freddiefujiwara/79434 to your computer and use it in GitHub Desktop.
This file contains 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
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