You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否创建预填充指定URL的Google日历订阅链接?

实现Google日历订阅链接的自动预填充

当然存在这样的功能,你可以构造特定格式的Google日历链接,让用户点击后直接跳转到添加日历的页面,并自动预填充目标日历URL,完全不需要手动复制粘贴。

具体实现步骤:

  • 替换协议:将你的webcal://开头的链接替换为https://,因为Google日历的订阅参数仅支持HTTP/HTTPS协议。
    你的原链接:webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith
    替换后:https://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith
  • URL编码:对替换后的链接进行URL编码处理,得到编码后的字符串:
    https%3A%2F%2Fdomain.co.uk%2Fcalendar%2Fexport.php%3FStaff%3DMr%2BAlan%2BSmith
  • 拼接最终链接:将编码后的字符串拼接到Google日历的订阅跳转链接中,格式如下:
    https://calendar.google.com/calendar/u/0/r?cid=编码后的日历链接
    
    对应你的情况,最终链接为:
    https://calendar.google.com/calendar/u/0/r?cid=https%3A%2F%2Fdomain.co.uk%2Fcalendar%2Fexport.php%3FStaff%3DMr%2BAlan%2BSmith
    

用户点击这个最终链接后,会直接进入Google日历的添加日历页面,目标URL已经自动填充到输入框内,只需点击“添加日历”就能完成订阅。

另外,也可以使用简化版的跳转链接格式,效果完全一致:

https://calendar.google.com/calendar/r/add?cid=https%3A%2F%2Fdomain.co.uk%2Fcalendar%2Fexport.php%3FStaff%3DMr%2BAlan%2BSmith

内容的提问来源于stack exchange,提问作者Henry Aspden

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 03:10:14