Geocaching Events | Add to calendar

Add geocaching event to calendar (link generator)

// ==UserScript==
// @name         Geocaching Events | Add to calendar
// @namespace    https://juroot.sk/
// @version      0.2
// @description  Add geocaching event to calendar (link generator)
// @author       JuRoot
// @match        https://www.geocaching.com/geocache/*
// @icon         https://www.google.com/s2/favicons?domain=geocaching.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    let calendarRun = false;

    window.onload = function() {
       if (isEventPage() && !calendarRun) {
           calendarRun = true;
           createCalendarLinks();
       }
    }

    function isEventPage() {
        let epst = document.getElementById("mcd3");
        let epet = document.getElementById("mcd4");
        let epsd = document.getElementById("ctl00_ContentBody_ShortDescription");
        return (epst!=null && epet!=null && epsd!=null);
    }

    function createCalendarLinks() {
        const ico_google = "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OCA0OCIgd2lkdGg9IjQ4IiBoZWlnaHQ9IjQ4Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTMgMTNoMjJ2MjJIMTN6Ii8+PHBhdGggZmlsbD0iIzFlODhlNSIgZD0iTTI1LjY4IDIwLjkybDEuMDA4IDEuNDQgMS41ODQtMS4xNTJ2OC4zNTJIMzBWMTguNjE2aC0xLjQ0ek0yMi45NDMgMjMuNzQ1Yy42MjUtLjU3NCAxLjAxMy0xLjM3IDEuMDEzLTIuMjQ5IDAtMS43NDctMS41MzMtMy4xNjgtMy40MTctMy4xNjgtMS42MDIgMC0yLjk3MiAxLjAwOS0zLjMzIDIuNDUzbDEuNjU3LjQyMWMuMTY1LS42NjQuODY4LTEuMTQ2IDEuNjczLTEuMTQ2Ljk0MiAwIDEuNzA5LjY0NiAxLjcwOSAxLjQ0IDAgLjc5NC0uNzY3IDEuNDQtMS43MDkgMS40NGgtLjk5N3YxLjcyOGguOTk3YzEuMDgxIDAgMS45OTMuNzUxIDEuOTkzIDEuNjQgMCAuOTA0LS44NjYgMS42NC0xLjkzMS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E3LjEgNS4yIDIzLjItMi4yIDQuNy01LjggNS0xNS43IDQuNi0yMi45eiIvPjwvc3ZnPg==";

        let epsdp = document.getElementById("ctl00_ContentBody_ShortDescription").innerText.split(",");
        if (epsdp.length > 1) {
            let en = document.getElementById("ctl00_ContentBody_CacheName").innerText;
            const regex = /\/(GC[a-zA-Z0-9]+)_?/gm;
            let gc = "";
            var ro = "";
            while ((ro = regex.exec(window.location)) !== null) {
                gc = ro[1];
            }
            let gcl = "https://coord.info/"+gc;
            let t = epsdp[1].split(" - ");
            let eds = new Date(epsdp[0] + " " + t[0]);
            let ede = new Date(epsdp[0] + " " + t[1]);
            let dsm0 = leadingZero(eds.getUTCMonth()+1); // because who doesn't count months from zero!?
            let dsd0 = leadingZero(eds.getUTCDate());
            let dsh0 = leadingZero(eds.getUTCHours());
            let dsi0 = leadingZero(eds.getUTCMinutes());
            let gds = ""+eds.getUTCFullYear()+dsm0+dsd0+"T"+dsh0+dsi0;
            let dem0 = leadingZero(ede.getUTCMonth()+1);
            let ded0 = leadingZero(ede.getUTCDate());
            let deh0 = leadingZero(ede.getUTCHours());
            let dei0 = leadingZero(ede.getUTCMinutes());
            let gde = ""+ede.getUTCFullYear()+dem0+ded0+"T"+deh0+dei0;
            let link_google = "https://calendar.google.com/calendar/render?action=TEMPLATE&dates="+gds+"00Z%2F"+gde+"00Z&text="+encodeURIComponent(en)+"&location="+encodeURIComponent(gcl);
            let out_google = "<a href=\""+link_google+"\" title=\"Google Calendar\" target=\"_blank\"><img width=\"16\" height=\"16\" alt=\"Google Calendar icon\" src=\"data:image/svg+xml;base64,"+ico_google+"\"></a>";
            let ods = ""+eds.getUTCFullYear()+"-"+dsm0+"-"+dsd0+"T"+dsh0+"%3A"+dsi0+"%3A00%2B00%3A00";
            let ode = ""+ede.getUTCFullYear()+"-"+dem0+"-"+ded0+"T"+deh0+"%3A"+dei0+"%3A00%2B00%3A00";
            let link_outlook = "https://outlook.live.com/calendar/0/deeplink/compose?body="+encodeURIComponent(gcl)+"&enddt="+ode+"&location=&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt="+ods+"&subject="+encodeURIComponent(en);
            let out_outlook = "<a href=\""+link_outlook+"\" title=\"Outlook\" target=\"_blank\"><img width=\"16\" height=\"16\" alt=\"Outlook icon\" src=\"data:image/svg+xml;base64,"+ico_outlook+"\"></a>";
            let link_office = "https://outlook.office.com/calendar/0/deeplink/compose?body="+encodeURIComponent(gcl)+"&enddt="+ode+"&location=&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt="+ods+"&subject="+encodeURIComponent(en);
            let out_office = "<a href=\""+link_office+"\" title=\"Office 365\" target=\"_blank\"><img width=\"16\" height=\"16\" alt=\"Office 365 icon\" src=\"data:image/svg+xml;base64,"+ico_office+"\"></a>";
            let link_yahoo = "https://calendar.yahoo.com/?desc="+encodeURIComponent(gcl)+"&et="+gde+"00Z&in_loc=&st="+gds+"00Z&title="+encodeURIComponent(en)+"&v=60";
            let out_yahoo = "<a href=\""+link_yahoo+"\" title=\"Yahoo!\" target=\"_blank\"><img width=\"16\" height=\"16\" alt=\"Yahoo! icon\" src=\"data:image/svg+xml;base64,"+ico_yahoo+"\"></a>";
            let output = "<span style=\"float:right;\">"+out_google+"&nbsp;&nbsp;"+out_outlook+"&nbsp;&nbsp;"+out_office+"&nbsp;&nbsp;"+out_yahoo+"</span>";
            document.getElementById("ctl00_ContentBody_ShortDescription").innerHTML += output;
            console.log(output);
        }
    }

    function leadingZero(input) {
        return (input < 10) ? "0"+input : input;
    }
})();