2014-03-31 35 views
37

我们可以通过parameters谷歌日历渲染动作模板参数文件

https://www.google.com/calendar/render? 
action=TEMPLATE& 
text=EventName& 
dates=20131206T050000Z/20131208T060000Z 
&location=EventLocation& 
sprop=name:Name& 
sprop=website:EventWebite& 
details=EventDetail& 
sf=true& 
output=xml 

使用此linkadd a new eventGoogle Calendar但我无法找到有关这些参数的任何文件。

有人知道它在哪里吗?

+0

文档请 –

+1

我有同样的问题。可能文档不存在。 –

+2

曾经有官方文件存在。 Google用现有Google日历中分享活动的信息取代了它。 : -/ –

回答

41

说明有关可用参数:

anchor address: 
http://www.google.com/calendar/event? 
This is the base of the address before the parameters below. 


action: 
    action=TEMPLATE 
    A default required parameter. 

src: 
    Example: src=default%40gmail.com 
    Format: src=text 
    This is not covered by Google help but is an optional parameter 
    in order to add an event to a shared calendar rather than a user's default. 

text: 
    Example: text=Garden%20Waste%20Collection 
    Format: text=text 
    This is a required parameter giving the event title. 

dates: 
    Example: dates=20090621T063000Z/20090621T080000Z 
      (i.e. an event on 21 June 2009 from 7.30am to 9.0am 
      British Summer Time (=GMT+1)). 
    Format: dates=YYYYMMDDToHHMMSSZ/YYYYMMDDToHHMMSSZ 
      This required parameter gives the start and end dates and times 
      (in Greenwich Mean Time) for the event. 

location: 
    Example: location=Home 
    Format: location=text 
    The obvious location field. 

trp: 
    Example: trp=false 
    Format: trp=true/false 
    Show event as busy (true) or available (false) 

sprop: 
    Example: sprop=http%3A%2F%2Fwww.me.org 
    Example: sprop=name:Home%20Page 
    Format: sprop=website and/or sprop=name:website_name 

add: 
    Example: add=default%40gmail.com 
    Format: add=guest email addresses 

http://useroffline.blogspot.com/2009/06/making-google-calendar-link.html

+2

虽然此链接可能回答问题,但最好包含答案的重要部分[此处](http://meta.stackoverflow.com/a/8259)并提供供参考的链接。如果链接页面更改,则仅链接答案可能会失效。 – bummi

+1

现在好了吗? :) –

+0

很酷的谢谢。但我认为需要官方文档=( –

12

The linksnoopy_15's answeran old Google URL当前正在重定向到new Google support page。这个新页面没有解释如何生成这个问题中提到的链接。

不过,多亏了Internet Archive: Wayback Machine的奇迹,older pages are still archived and available

The latest available version is from March 2012,它包含一个简单的JavaScript代码仍然有效的表单!当然,这不是一个官方文档(我仍在寻找一个),这不是文档(这是一个脚本的交互式表单),但它是我能得到的最接近的。

+0

惊喜回答:微笑: –

+0

超级duper :)。真棒 –

5

这是当我创建这些链接,我使用的参数。还有其他参数存在,但我不觉得它们有用,它们是可选的。关于日期如何工作的细节特别令人烦恼,并且从未被谷歌充分记录。

  • 行动=模板(必需)
  • 文本(URL编码的事件的名称)
  • 日期(ISO日期格式,开始日期/结束日期 - 必须开始和结束时间,也赢得了” :T工作的开始和结束日期可以是相同的,如果适用)
    • 使用用户的时区:20161208T160000/20161208T180000
    • 使用水珠人的时间,转换为UTC,然后用20131208T160000Z/20131208T180000Z
    • 一整天的活动,您可以使用二千零十六万一千二百零九分之二千零十六万一千二百零八 - 注意,旧版的谷歌文档,得到它错了。您必须使用以下日期作为一天全天事件的结束日期,或者将+1天作为结束日期的结束日期。
  • 细节(URL编码的事件描述/细节)
  • 位置(该事件的URL编码的位置 - 确保它的地址谷歌地图可以轻松读取)
+0

这太棒了!你有什么想法是什么'sf'参数是偶然的? – jayp

+1

我不知道'sf'做了什么,但是让我们知道如果你通过实验发现!很明显,这不会被谷歌记录或支持,即使它现在仍然有效。 – squarecandy

+1

感谢您指出如何使用用户的本地时区,只需放下Z即可。无法相信Google不会记录这些内容并使其更容易! – Utkanos