Skip to content

Instantly share code, notes, and snippets.

@Zegnat
Forked from 4rn0/kick-it.html
Last active December 21, 2015 16:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Zegnat/6333616 to your computer and use it in GitHub Desktop.
Save Zegnat/6333616 to your computer and use it in GitHub Desktop.
<a href="http://causeyoucantyouwontandyoudontstop.com/" class="kick-it">Kick it!</a>
(function(ki,ck,i,t){
for (
i = 0,
t = ki.length;
i < t;
ki[i++].href = 'https://youtu.be/' +
ck[Math.floor(Math.random()*ck.length)]
);
})(
document.querySelectorAll('a.kick-it'),
[
'qORYO0atB6g', //Intergalactic
'z5rRZdiu1UE', //Sabotage
'uvRBUw_Ls2o', //Body Movin'
'BptQHAW2T5M', //Shake Your Rump
'eBShN8qT4lk', //(You Gotta) Fight For Your Right (To Party)
'07Y0cy-nvAg', //No Sleep Till Brooklyn
'Xf1YF_MH1xc', //Root Down
'evA-R9OS-Vo', //Fight For Your Right (Revisited)
'ru3gH27Fn6E', //So What Cha Want
'Z6xsKsJqVyg', //SABOTAGE (Live, awesome!!)
'D4-F6QFcNxQ', //B-Boys Makin With The Freak Freak
'XflfiylNNXY' //Three MC's and One DJ
]
);
(function(ki,ck,i,t){for(i=0,t=ki.length;i<t;ki[i++].href='https://youtu.be/'+ck[Math.floor(Math.random()*ck.length)]);})(document.querySelectorAll('a.kick-it'),['qORYO0atB6g','z5rRZdiu1UE','uvRBUw_Ls2o','BptQHAW2T5M','eBShN8qT4lk','07Y0cy-nvAg','Xf1YF_MH1xc','evA-R9OS-Vo','ru3gH27Fn6E','Z6xsKsJqVyg','D4-F6QFcNxQ','XflfiylNNXY']);
/* This can be made shorter by removing the ‘kickit’ reference at the start,
* and by substituting the array with a 'string'.split(' ').
* As done by Google Closure Compiler:
(function(b,c,a,d){a=0;for(d=b.length;a<d;b[a++].href="https://youtu.be/"+c[Math.floor(Math.random()*c.length)]);})(document.querySelectorAll("a.kick-it"),"qORYO0atB6g z5rRZdiu1UE uvRBUw_Ls2o BptQHAW2T5M eBShN8qT4lk 07Y0cy-nvAg Xf1YF_MH1xc evA-R9OS-Vo ru3gH27Fn6E Z6xsKsJqVyg D4-F6QFcNxQ XflfiylNNXY".split(" "));
* This is really no fun though.
*/
@4rn0
Copy link

4rn0 commented Aug 27, 2013

Awesome! Douze points for coding style !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment