Created
April 12, 2014 15:37
-
-
Save cameronbaney/10541834 to your computer and use it in GitHub Desktop.
Social sharing on Youtube
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<!-- | |
****INSTRUCTIONS**** | |
To use this, link to this file in your annotations with ?v={videoID} | |
For Example: http://MyWebSite.tld/facebookshare.html?v=GWRnHGjLDpk | |
If you have any questions or suggestions, please PM my Youtube account: http://www.youtube.com/user/ThreeDigitIQ | |
Thanks, | |
ThreeDigitIQ | |
--> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> | |
<script type="text/javascript"> | |
var videoID = getUrlVars()["v"]; | |
function getUrlVars() { | |
var vars = {}; | |
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | |
vars[key] = value; | |
}); | |
return vars; | |
} | |
setTimeout('delayer(videoID)',100); | |
function delayer(videoID){ | |
if (typeof videoID === "undefined"){ | |
window.location = "https://www.youtube.com/user/adoptiondrive"; | |
}else{ | |
window.location = "https://twitter.com/intent/tweet?source=webclient&text=These%20cute%20puppies%20figured%20out%20a%20clever%20way%20to%20raise%20money%20for%20dogs%20in%20need.%20Watch%20and%20enjoy.%20%23sharefordogs%20http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D"+videoID; | |
} | |
} | |
</script> | |
<title> | |
</title> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment