Compare commits
2 Commits
d7de5841d0
...
5a00247eef
Author | SHA1 | Date |
---|---|---|
Ryan Mwangi | 5a00247eef | |
Ryan Mwangi | 77136f1a14 |
27
server.js
27
server.js
|
@ -103,6 +103,33 @@ app.get('/:filename', (req, res) => {
|
|||
// Store the merged calendar URL in a file
|
||||
const mergedCalendarUrlFile = 'merged_calendar_url.txt';
|
||||
|
||||
|
||||
//calendarData object to store calendar data
|
||||
let calendarData = {
|
||||
linkGroups: []
|
||||
};
|
||||
|
||||
// Function to add a new link group
|
||||
function addLinkGroup(name) {
|
||||
const newLinkGroup = {
|
||||
name,
|
||||
links: []
|
||||
};
|
||||
calendarData.linkGroups.push(newLinkGroup);
|
||||
return newLinkGroup;
|
||||
}
|
||||
|
||||
// Function to add a new link to a link group
|
||||
function addLinkToGroup(linkGroup, url, prefix, overrideSummary) {
|
||||
const newLink = {
|
||||
url,
|
||||
prefix,
|
||||
overrideSummary
|
||||
};
|
||||
linkGroup.links.push(newLink);
|
||||
return newLink;
|
||||
}
|
||||
|
||||
// Function to update the merged calendar
|
||||
async function updateMergedCalendar(){
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue