Last active
January 11, 2024 09:43
-
-
Save Kipjr/f72614748f1d16245f5e6a39cee9f024 to your computer and use it in GitHub Desktop.
Checks the boxes of OV-Chipkaart reishistory based on parameters
This file contains 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
// press F12 and paste this in console | |
// https://www.ov-chipkaart.nl/nl/mijn-ov-chip/mijn-ov-reishistorie | |
// | |
// Blaak,Utrecht,Amsterdam | |
const stationsRAW = prompt("Stationsnamen"); | |
const stations = stationsRAW.split(",") | |
const werkdagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag','vrijdag']; | |
var uncheckall = document.getElementById("ag-5-input"); uncheckall.click(); | |
var rows = [...document.getElementsByClassName("ag-row")]; | |
for (var i=0; i < rows.length;i++){ | |
if(rows[i].innerText.includes("Check-uit")){ | |
if (werkdagen.some(substring => rows[i].innerText.includes(substring))) { | |
if (stations.some(substring => rows[i].innerText.includes(substring))) { | |
check = rows[i].getElementsByTagName("input") | |
check[0].click() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment