Skip to content

Instantly share code, notes, and snippets.

@Kipjr
Last active January 11, 2024 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kipjr/f72614748f1d16245f5e6a39cee9f024 to your computer and use it in GitHub Desktop.
Save Kipjr/f72614748f1d16245f5e6a39cee9f024 to your computer and use it in GitHub Desktop.
Checks the boxes of OV-Chipkaart reishistory based on parameters
// 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