Sync multiple iCalendars (Airbnb, Flipkey, Google Calendar, etc)

拈花ヽ惹草 提交于 2019-12-03 08:52:06

After some research, I found this solution:

1) Use this library: http://kigkonsult.se/iCalcreator/

2) Get the ICS feeds and merge them and then create a new ICS (create both "import" and "export" folders and give them writing permissions).

require_once('../classes/iCalcreator/iCalcreator.class.php');

$config2 = array("unique_id" => "kigkonsult2.se",
     "directory" => "import",
);
$vcalendar2 = new vcalendar($config2);

$vcalendar2->setConfig("url" , "https://someweb/cal.ics");

$vcalendar2->parse();

$vcalendar2->setConfig("url" , "https://anotherurl/cal2.ics");
$vcalendar2->parse();

$vcalendar2->setConfig("directory", "export");
$vcalendar2->setConfig("filename", "icalmerge3.ics");
$vcalendar2->saveCalendar();


echo "done";

3) Create a CRON scheduler to run this file recurrently. Point both Airbnb and Flipkey to the url where the feed is created. You can use as many input ICS files as you want.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!