
            <!DOCTYPE html>
            <html>
                <head><title>Eventbrite-to-iCal Converter</title></head>
                <body>
                    <h1>Eventbrite-to-iCal Converter</h1>
                    <p>Convert an Eventbrite Organizer's profile into an iCal (.ics) calendar</p>
                    <form action="/eventbrite-organizer-ical" target="_blank" method="get">
                        <input placeholder="(e.g. https://www.eventbrite.com/o/privacy-lab-7851144983)"
                               name="organizer"
                               value=""
                               style="width:30em;">
                        <input type="submit" value="Generate iCal URL">
                    </form>
                    <p id="error" style="color:red;display:none;">
                        Organizer profile url or id is required.
                    </p>
                    <p id="result" style="display:none;">
                        iCal URL:
                        <a href="#" target="_blank"></a>
                    </p>
                    <footer style="margin-top:2em;font-size:80%">
                        Free and open source (GNU AGPLv3):
                        <a href="https://github.com/diafygi/eb-to-ical"
                           target="_blank" rel="noopener noreferrer"
                           >https://github.com/diafygi/eb-to-ical</a>
                    </footer>
                    <script>
                        document.querySelector("form").addEventListener("submit", function(e){
                            e.preventDefault();
                            var organizer = document.querySelector("input[name=organizer]").value;
                            if(organizer){
                                var url = location.protocol + "//" + location.hostname + (location.port ? ":" + location.port : "");
                                url += document.querySelector("form").getAttribute("action");
                                url += "?organizer=" + encodeURIComponent(organizer);
                                document.querySelector("#result a").href = url;
                                document.querySelector("#result a").innerText = url;
                                document.querySelector("#result").style.display = "block";
                                document.querySelector("#error").style.display = "none";
                            } else {
                                document.querySelector("#result").style.display = "none";
                                document.querySelector("#error").style.display = "block";
                            }
                        });
                    </script>
                </body>
            </html>
        