Is there way for Wappler to create an iCal feed file (.ics)? I have a database of a schedule of events, and I am wanting to create a live iCalendar feed of the events. Any suggestions?
Anyone any ideas on this one?
I actually just put this in a couple weeks ago as a module using https://www.npmjs.com/package/ics
Care to share the module?
I havenāt really built it to share (specific to my use case, no documentation, doesnāt support all the features), but happy to provide it to get you started. It creates an .ics file for the event, which you can then use in a File Download action.
ics_module.zip (2.2 KB) etc.)
Iād love to see this as a Feature Request. I would love to be able to do this but it is way beyond my capabilities.
Perhaps some sort of .csv converter? Seems that is a popular way to go and we can already download .csv files.
Why not create a request then? Go Brad!
Because I am not sure what to request exactly as I am clueless to if this can even be done. Would also need to export to other calendar such as Android and Windows which I no exactly nothing about their calendars.
We work with PHP and not Nodejsā¦ so dont know if this will be a solution for you guysā¦
but happy to share this with youā¦ it creates a vcs but im sure you can just change it to icsā¦ not sure
We just pass the variables that is needed to our PHP pageā¦ and it generates itā¦
Just change the āvariablesā to what you need it to beā¦
<?php
$EventNameFile = $_GET['event_name'];
$EventNameFile = preg_replace('/\s+/', '_', $EventNameFile);
$Filename = $EventNameFile . ".vcs";
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: inline; filename=$Filename");
$startdate = $_GET['event_start_date'];
$enddate = $_GET['event_end_date'];
$starttime = $_GET['arrival_time'];
$endtime = $_GET['end_time'];
$combined_starttime = "$startdate" . "$starttime";
$combined_endtime = "$enddate" . "$endtime";
$unixstarttime = strtotime($combined_starttime);
$unixendtime = strtotime($combined_endtime);
$vCalStart = date("Ymd\THi00", $unixstarttime);
$vCalEnd = date("Ymd\THi00", $unixendtime);
$vEvent = $_GET['event_name'];
$vLocation = $_GET['venue_city'];
$vContactPerson = $_GET['contact_person_name'];
$vContactEmail = $_GET['contact_person_email'];
$vContactNumber = $_GET['contact_person_mobile'];
$vContent = $_GET['template_wording_register'];
?>
BEGIN:VCALENDAR
VERSION:1.0
PRODID:<?php echo $vEvent . "\n"; ?>
TZ:-07
BEGIN:VEVENT
SUMMARY:<?php echo $vEvent . "\n"; ?>
DTSTART:<?php echo $vCalStart . "\n"; ?>
DTEND:<?php echo $vCalEnd . "\n"; ?>
LOCATION:<?php echo $vLocation . "\n"; ?>
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=
<?php echo $vContent; ?>
=0D=0A=0D=0AFor more information, please contact <?php echo $vContactPerson; ?> on <?php echo $vContactEmail; ?> or <?php echo $vContactNumber; ?>.
END:VEVENT
END:VCALENDAR
Anyone done this with Node? I got it to work in PHPā¦
But im new to the Node side of thingsā¦ anybody tried itā¦
Here you have a nodejs library.
You could build a custom extension for it. Could be useful for others and itās a nice way to learn. Remember, nodejs is just javascript running on a server
thanks Jonā¦ busy converting my php site that i was dreading to nodeā¦ so far so goodā¦ just one or two things i did in php that i have no clue about in nodeā¦ but ill get thereā¦ but ill post a full review on your infamous topic " Why I stopped creating PHP projects with Wappler and why you probably should too" ā¦ heheh ā¦ just to list my experienceā¦
thanks for the help.
Hi thanks for providing this moduleā¦
I have installed itā¦
I have installed npm ics
Could you perhaps share your settings / eg screenshot?
As I want to figure out where im going wrongā¦
Can anybody ā¦ do a small screen grab on how to execute the node once i have installed itā¦
I have watched videos on youtubeā¦ but im missing something clearlyā¦
Once i have installed the npmā¦ i create a file egā¦ app.js in the rootā¦
but this is where i get totally stuckā¦ how do you execute or call this node app.js ???
In the terminal i type node app.jsā¦ it outputs correctly in the logā¦
My question isā¦ now on my pageā¦ say index.js within the (VIEWS) folderā¦ how do i āexecuteā this app.js to run? sorry if this is a stupid questionā¦ but i have to ask as this is where i dont understandā¦
Anybody that can do a video on how to do this one? So that i can learn and do the next one?
The extension expects a datetime formatted value (eg .formatDate('yyyy-MM-dd HH:mm')
Thanks Ken - Much appreciatedā¦ it helped me alotā¦ thank you for this
Thanks to Ken for this Module. @mebeingken
I have updated it a little bit to allow for Location * Not required
And also added a default value in the date so that one can see the format it needs to be.
You can download it here ā¦
ics-modules-updated.zip (1.6 KB)