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

前端 未结 1 1714
一个人的身影
一个人的身影 2021-02-10 18:23

I\'m developing a website for apartments rental. I\'m using a wordpress hotel theme that I tweaked so instead of \"rooms\" it uses \"flats\" and a booking plug-in. Each of this

1条回答
  •  野的像风
    2021-02-10 18:51

    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.

    0 讨论(0)
提交回复
热议问题