Browse Source

update log and remove events.json

mrkvon 2 years ago
parent
commit
8a646af0b8
3 changed files with 24 additions and 4927 deletions
  1. 1
    0
      .gitignore
  2. 0
    4923
      events.json
  3. 23
    4
      index.mjs

+ 1
- 0
.gitignore View File

@@ -1 +1,2 @@
1 1
 node_modules
2
+events.json

+ 0
- 4923
events.json
File diff suppressed because it is too large
View File


+ 23
- 4
index.mjs View File

@@ -3,13 +3,32 @@ import ical2json from 'ical2json';
3 3
 import fs from 'fs-extra';
4 4
 
5 5
 (async function () {
6
-  let events = [];
6
+
7
+  console.log(`
8
+*******************
9
+Ahoj.
10
+     .
11
+      . ____/
12
+       < *__|
13
+       /\\  /\\
14
+
15
+*******************`);
7 16
   // get current events
8
-  events = events.concat(await getEvents());
17
+  const currentEvents = await getEvents();
9 18
   // get past events
10
-  events = events.concat(await getEvents(true));
19
+  const pastEvents = await getEvents(true);
20
+
21
+  const events = [...currentEvents, ...pastEvents];
22
+
23
+  console.log(`
24
+Found ${events.length} events.
25
+${currentEvents.length} events will be in the future.
26
+${pastEvents.length} events already happened.
27
+
28
+See them all in events.json.
11 29
 
12
-  console.log(events.length);
30
+*******************
31
+`);
13 32
 
14 33
   await fs.writeJson('events.json', events, { spaces: 2 });
15 34
 }());