For all that use iCloud calendar but don't want to use an public service processing their calendar items (privacy)
I download the ical from iCloud every 5 minutes to a local folder and use this local file for the calendar plugin
the file is a php file, so you need php available
create in custom a new folder :
mkdir ical
place this file to this folder
change the path in the file for $local_file, use full path because it will run from cronjob
$remote_file = url from iCloud calendar (in example the dutch holiday's) but you can use this for you own shared iCloud calendar.
calendar.feestdagen.php
Code: Select all
<?php
$local_file = "/var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.feestdagen.ics";//This is the file where we save the information
$remote_file = "https://p58-calendars.icloud.com/holidays/nl_nl.ics"; //Here is the file we are downloading
$ch = curl_init();
$fp = fopen ($local_file, 'w+');
$ch = curl_init($remote_file);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_exec($ch);
curl_close($ch);
fclose($fp);
open 'crontab -e'
Code: Select all
*/5 * * * * /usr/bin/php /var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.gezamenlijk.php
00 00 * * * /usr/bin/php /var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.feestdagen.php
I use two scripts, one for holidays, update every day once at 00:00 hour
and second script run every 5 minutes to update the iCloud shared calendar (gezamenlijke) these two icals will be used in Dashticz
CONFIG.js
Code: Select all
var calendars = {}
calendars.gezamenlijk = { icalurl: 'custom/ical/calendar.gezamenlijk.ics' }
calendars.feestdagen = { icalurl: 'custom/ical/calendar.feestdagen.ics' }
calendars.combined = {}
calendars.combined.calendars = [
{ color:'white',calendar:calendars.gezamenlijk },
{ color:'#ccc',calendar:calendars.feestdagen }
]
calendars.combined.url = 'https://www.icloud.com/#calendar';
columns[2]['blocks'] = [314,315,399,'blocktitle_6','buttons.cameravoordeur','blocktitle_14',[b]calendars.combined[/b]]