forked from NclRSE-Training/WorkshopAdmin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathiCalendarGen.sh
More file actions
executable file
·58 lines (52 loc) · 1.69 KB
/
iCalendarGen.sh
File metadata and controls
executable file
·58 lines (52 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Organisation,Venue,Slug,Title,Address,Country,Language,Latitude,Longitude,Humandate,Humantime,Startdate,Enddate,Instructors,Eventbrite,Pilot,Carpentry,Curriculum,Flavour,Incuabtor_lesson_site,Pre-workshop-survey,Post-workshop-survey,what3words,schedule
#!/bin/sh
SLUG=$1
UUID=`uuidgen`
PRODID=CarpentriesMagic
# extract startdate, remove - (hyphens)
STARTDATE=`cat example.csv |grep $SLUG|cut -d"," -f12|sed "s/-//g"`
STARTTIME=`cat example.csv |grep $SLUG|cut -d"," -f11|cut -d"-" -f1`
# extract enddate, remove - (hyphens)
ENDDATE=`cat example.csv |grep $SLUG|cut -d"," -f13|sed "s/-//g"`
ENDTIME=`cat example.csv |grep $SLUG|cut -d"," -f11|cut -d"-" -f2`
DTSTART=${STARTDATE}T${STARTTIME}
DTEND=${ENDDATE}T${ENDTIME}
VENUE=`cat example.csv|grep $SLUG|cut -d"," -f2`
echo BEGIN:VCALENDAR
echo VERSION:2.O
echo PRODID:${PRODID}
echo METHOD:PUBLISH
echo BEGIN:VEVENT
echo DTSTART:${DTSTART}
echo DTEND:${DTEND}
echo TRANSP:TRANSPARENT
echo SUMMARY:Workshop
echo DESCRIPTION:
echo LOCATION:${VENUE}
echo URL;VALUE=URI:https://www.timeanddate.com/worldclock/meetingdetails.html?i
echo so=20250515T1400&p1=136
echo UID:https://www.timeanddate.com/worldclock/meetingdetails.html?iso=2025051
echo 5T1400&p1=136
echo DTSTAMP:`date +%Y%m%dT%H%M%S`
echo END:VEVENT
echo END:VCALENDAR
cat <<EOM >>${SLUG}.ics
BEGIN:VCALENDAR
VERSION:2.O
PRODID:${PRODID}
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART:${DTSTART}
DTEND:${DTEND}
TRANSP:TRANSPARENT
SUMMARY:Workshop
DESCRIPTION:
LOCATION:${VENUE}
URL;VALUE=URI:https://www.timeanddate.com/worldclock/meetingdetails.html?i
so=20250515T1400&p1=136
UID:https://www.timeanddate.com/worldclock/meetingdetails.html?iso=2025051
5T1400&p1=136
DTSTAMP:`date +%Y%m%dT%H%M%S`
END:VEVENT
END:VCALENDAR
EOM