Synchronizing multiple iCalendars (Airbnb, Flipkey, Google Calendar, etc.)

I am developing a website for renting apartments. I am using a Wordpress theme that I have customized, instead of "rooms" it uses "apartments" and a booking plugin. Each of these apartments is also advertised on Airbnb and FlipKey.

I need to sync all calendars so that, for example, someone booked an apartment on Airbnb, this apartment is automatically marked as "not available" both on the site and on Flipkey. This is done using feeds provided by both companies. There is an output channel and an input feed for both, so if I insert the pin on the input of the other and vice versa, the thing works fine.

Now I need a way to centralize my calendar in one system and use that system to feed contributions from Airbnb, Flipkey and my own wordpress booking plugin. I tried this with:

PHP iCalendar (it can, like google calendar, receive feeds, but that's not the case as far as I know - provides a single output). The services http://www.accommodationcalendar.com only receive input, but no output.

Maybe http://www.davical.org/ might be a good option, but since I am using shared hosting I cannot install it (as far as I know) - the reason is that the shared hosting only has MySql and not PostgreSQL.

Does anyone have any idea how to solve this?

THANK!

+3


source to share


1 answer


After some research I found this solution:

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

2) Get the ICS channels and merge them and then create a new ICS (create "import" and "export" folders and give them write 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 periodically. Point both Airbnb and Flipkey to the URL where the feed is generated. You can use as many ICS input files as you like.

+1


source







All Articles