Skip to content

Instantly share code, notes, and snippets.

@markusdosch
Last active June 4, 2021 18:20
Show Gist options
  • Save markusdosch/9c8f12864d36f9b2301774c2f4aacc8c to your computer and use it in GitHub Desktop.
Save markusdosch/9c8f12864d36f9b2301774c2f4aacc8c to your computer and use it in GitHub Desktop.
Kicktipp Data Export with Ctrl+Shift+K (Tampermonkey Userscript)
// ==UserScript==
// @name Kicktipp Data Export
// @namespace http://tampermonkey.net/
// @version 0.3
// @downloadURL https://gist.github.com/markusdosch/9c8f12864d36f9b2301774c2f4aacc8c/raw/
// @updateURL https://gist.github.com/markusdosch/9c8f12864d36f9b2301774c2f4aacc8c/raw/
// @description Export all Kicktipp data with Ctrl+Shift+K when on Export page
// @author Markus Dosch
// @match https://www.kicktipp.de/*/spielleiter/datenexport
// @grant none
// ==/UserScript==
// How to install via GitHub Gist:
// Install Tampermonkey, visit this page and and click on "Raw" => Tampermonkey dialog opens and allows you to install the script.
// If auto-updating is enabled in your settings, this script will auto-update itself.
(function() {
'use strict';
function timeout(ms) {
return new Promise(res => setTimeout(res, ms))
}
async function action() {
const datenauswahl = document.getElementById("datenauswahl");
const tippspieltagIndex = document.getElementById("tippspieltagIndex");
const submitbutton = document.getElementsByName("submitbutton")[0];
// const wertung = document.getElementById("wertung"); // No modification of default value needed
// Export "Liste aller Tipper"
datenauswahl.value = "tipperliste"
await timeout(500);
submitbutton.click();
datenauswahl.value = "ranking"
for (let i = 0; i < tippspieltagIndex.options.length; i++) {
tippspieltagIndex.value = tippspieltagIndex.options[i].value;
await timeout(500);
submitbutton.click();
}
datenauswahl.value = "tipps"
for (let i = 0; i < tippspieltagIndex.options.length; i++) {
tippspieltagIndex.value = tippspieltagIndex.options[i].value;
await timeout(500);
submitbutton.click();
}
alert("Finished export")
}
window.addEventListener('keypress', function(e){
if (e.shiftKey && e.ctrlKey && e.key == "K") {
action();
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment