同步多个iCalendar(Airbnb,Flipkey,Google日历等) [英] Sync multiple iCalendars (Airbnb, Flipkey, Google Calendar, etc)

查看:152
本文介绍了同步多个iCalendar(Airbnb,Flipkey,Google日历等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个公寓出租网站。我使用了经过调整的wordpress酒店主题,因此它使用的是公寓和预订插件,而不是房间。每个单位都在Airbnb和FlipKey中做广告。

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 flats are also advertised in Airbnb and FlipKey.

我需要的是能够同步所有日历,因此,例如,如果有人在Airbnb中预订了该公寓,则在该公寓中该公寓会自动标记为不可用网站和Flipkey。这是通过两家公司提供的feeds.ics完成的。两者都有一个输出提要和一个输入提要,所以如果我将输出粘贴到另一个的输入中,反之亦然,那么事情就很好了。

What I need is to able to sync all the calendars so if, for instance, someone books the flat in Airbnb, that flat is automatically marked as "non available" in both the website and Flipkey. This is done using feeds .ics that are provided by both companies. There is an output feed and an input feed for both, so if I paste the output in the input of the other and vice versa, the thing works perfectly.

现在,我需要的是一种既可以将日历集中在一个系统中,又可以使用该系统提供Airbnb,Flipkey和我自己的wordpress预订插件的输入的方法。我已经尝试过:

Now, what I need is a way of centralizing both calendar in one system and using that system to feed the inputs of Airbnb, Flipkey and my own booking plugin of wordpress. I've tried that with:

PHP iCalendar(它可以作为Google日历获取供稿,但据我所知,它不能提供统一输出)。作为 http://www.accommodationcalendar.com
服务仅获得输入,但也没有输出。

PHP iCalendar (it can, as google calendar, get the feeds, but it doesn't -as far as I know- provide an unified output). Services as http://www.accommodationcalendar.com only get the input, but no output either.

也许 http://www.davical.org/可能是一个不错的选择,但就我使用共享主机而言,我无法安装它(据我所知)-原因是共享主机仅具有MySql而没有PostgreSQL。

Maybe http://www.davical.org/ could be a good option, but as I'm using a shared hosting, I can't install it (as far as I know) -the reason being that the shared hosting only has MySql and not PostgreSQL.

有人知道如何解决吗?

谢谢!

推荐答案

经过研究,我找到了以下解决方案:

After some research, I found this solution:

1)使用此库: http://kigkonsult.se/iCalcreator/

2)获取ICS提要并合并它们,然后创建一个新的ICS(同时创建导入和导出文件夹,并为其赋予写权限)。

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)创建一个CRON调度程序以周期性地运行此文件。将Airbnb和Flipkey都指向创建供稿的网址。您可以根据需要使用任意多个输入ICS文件。

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.

这篇关于同步多个iCalendar(Airbnb,Flipkey,Google日历等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆