Created
August 7, 2012 13:00
-
-
Save fcamblor/3285107 to your computer and use it in GitHub Desktop.
Google doodle beaten :)
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
// Execute this script in frame "hplogo-complex" on https://www.google.com/doodles/hurdles-2012 :-) | |
var script = document.createElement('script'); | |
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'; | |
script.type = 'text/javascript'; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
window.skip = false; | |
window.target = "#hplogo_pc"; | |
// Define here the time interval between 2 arrow hits :) | |
window.interval = 15; | |
setInterval(function(){ | |
// Allows to stop hitting left and right arrows | |
if(!window.skip){ | |
$(target).trigger(jQuery.Event("keydown", { keyCode: 39 })); | |
$(target).trigger(jQuery.Event("keyup", { keyCode: 39 })); | |
console.log("clicked right"); | |
setTimeout(function(){ | |
$(target).trigger(jQuery.Event("keydown", { keyCode: 37 })); | |
$(target).trigger(jQuery.Event("keyup", { keyCode: 37 })); | |
console.log("clicked left"); | |
},interval); | |
} | |
}, interval*2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment