Skip to content

Instantly share code, notes, and snippets.

@fabiomadge
Last active August 29, 2015 14:07
Show Gist options
  • Save fabiomadge/abccb162cca9b83d5182 to your computer and use it in GitHub Desktop.
Save fabiomadge/abccb162cca9b83d5182 to your computer and use it in GitHub Desktop.
Auto Booker
javascript:function initiate(){var line=prompt("Please enter the line of your desired group","1");autoSignUp(line);}function autoSignUp(group){if(document.getElementById("InfoDIV")!=null){if(document.getElementById("InfoDIV").style.visibility!="hidden")closeMyAlert();}var groupString=group.toString();var buttonName="btn0000".slice(0,(7-groupString.length))+groupString;if(document.getElementsByName(buttonName).length>0){document.getElementsByName(buttonName)[0].onclick();}else{console.log("Sorry, too late!");return;}if(document.getElementById("InfoDIV")!=null){if(document.getElementById("InfoDIV").style.visibility!="hidden")closeMyAlert();}var d=new Date();console.log(d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+":"+d.getMilliseconds());if(document.getElementsByTagName('body')[0].innerHTML.indexOf("noch nicht angemeldet")>0){setTimeout(function(){autoSignUp(group);},150);}}initiate();
javascript:function initiate(){
var line = prompt("Please enter the line of your desired group", "1");
autoSignUp(line);
}
function autoSignUp(group){
if(document.getElementById("InfoDIV") != null){
if(document.getElementById("InfoDIV").style.visibility != "hidden") closeMyAlert();
}
var groupString = group.toString();
var buttonName = "btn0000".slice(0,(7 - groupString.length)) + groupString;
if(document.getElementsByName(buttonName).length > 0){
document.getElementsByName(buttonName)[0].onclick();
}
else{
console.log("Sorry, too late!");
return;
}
if(document.getElementById("InfoDIV") != null){
if(document.getElementById("InfoDIV").style.visibility != "hidden") closeMyAlert();
}
var d = new Date();
console.log(d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + ":" + d.getMilliseconds());
if(document.getElementsByTagName('body')[0].innerHTML.indexOf("noch nicht angemeldet") > 0){
setTimeout(function() {autoSignUp(group);},150);
}
}initiate();
function autoSignUp(group){
if(document.getElementById("InfoDIV") != null){
if(document.getElementById("InfoDIV").style.visibility != "hidden") closeMyAlert();
}
//assamble name of signup button
var groupString = group.toString();
var buttonName = "btn0000".slice(0,(7 - groupString.length)) + groupString;
//click anmelden
if(document.getElementsByName(buttonName).length > 0){
document.getElementsByName(buttonName)[0].onclick();
}
else {
console.log("Sorry, too late!");
return;
}
if(document.getElementById("InfoDIV") != null){
if(document.getElementById("InfoDIV").style.visibility != "hidden") closeMyAlert();
}
//log time
var d = new Date();
console.log(d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + ":" + d.getMilliseconds());
//set next try for in 150ms
if(document.getElementsByTagName('body')[0].innerHTML.indexOf("noch nicht angemeldet") > 0){
setTimeout(function() {autoSignUp(group);},150);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment