forked from evertheylen/notion-export-ics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_url.html
More file actions
43 lines (39 loc) · 1.44 KB
/
create_url.html
File metadata and controls
43 lines (39 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<title>Export Notion Calendar to ICS (and import anywhere else)</title>
<style>
input {
display: block;
width: calc(100% - 20px);
margin: 10px;
font-size: 20px;
}
</style>
</head>
<body>
<label for='url'>URL of the Calendar View</label>
<input id='url' placeholder="https://notion.so/...">
<label for='format'>Title format</label>
<input id='format' value='{NAME}'>
<label for='result'>Resulting URL</label>
<input id='result' placeholder='loading...' readonly onclick="this.select(); document.execCommand('copy')">
<script>
document.addEventListener("DOMContentLoaded", function(event) {
let url_el = document.getElementById('url');
let format_el = document.getElementById('format');
let res_el = document.getElementById('result');
function recalc_url() {
let url = window.btoa(url_el.value);
let format = window.btoa(format_el.value);
res = new URL('/ics', window.location.href);
res.searchParams.append('url', url);
res.searchParams.append('format', format);
res_el.value = res.href;
}
url_el.addEventListener("input", recalc_url);
format_el.addEventListener("input", recalc_url);
recalc_url();
});
</script>
</body>
</html>