Click to show the code of the bookmarklet...
/*Savefile.js minified*/
/*ICS.js minified*/
fetch("https://prod-a-v2api.speedadmin.dk/tuition/activity/activity/getactivities", {
"headers": {"accept": "application/json, text/plain, */*",},
"referrer": "https://speedadmin.dk/",
"body": null,
"method": "POST",
"mode": "cors",
"credentials": "include"
}).then(data=>data.json()).then(data=>{
for(var i=0;i<data.length;i++){
console.log(decodeURIComponent(data[i].mapsSearchString.replaceAll("+"," ")));
today=new Date();
window.activity=data[i];
fetch("https://prod-a-v2api.speedadmin.dk/booking/booking/schedule/getschedule", {
"headers": {"content-type": "application/json",},
"referrer": "https://speedadmin.dk/",
"body": JSON.stringify({
"masterResourceId": data[i].studentMasterResourceId,
"showOwnedBookings": true,
"startDate": new Date(today.getFullYear()-5,today.getMonth(),today.getDate()).toISOString(),
"endDate": new Date(today.getFullYear()+5,today.getMonth(),today.getDate()).toISOString()
}),
"method": "POST",
"mode": "cors",
"credentials": "include"
}).then(data2=>data2.json()).then(data2=>{
var cal = ics();
for(var k=0;k<data2.timeslots.length;k++){
timeslot=data2.timeslots[k];
cal.addEvent(timeslot.bookingV2Title, timeslot.offeringName, decodeURIComponent(window.activity.mapsSearchString.replaceAll("+"," "))+", "+window.activity.room, timeslot.startDateTime, timeslot.endDateTime);
}
cal.download("speedadmin.ics");
});}});