Skip to content

Instantly share code, notes, and snippets.

@fcamblor
Created August 7, 2012 13:00
Show Gist options
  • Save fcamblor/3285107 to your computer and use it in GitHub Desktop.
Save fcamblor/3285107 to your computer and use it in GitHub Desktop.
Google doodle beaten :)
// 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