如何建立到谷歌日历事件的HTML链接? [英] How to build html link to a google calendar event?

查看:165
本文介绍了如何建立到谷歌日历事件的HTML链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google日历API v3,我向Google日历添加了一个活动。现在我想建立一个html链接,以便有人可以点击并查看日历事件。



这是我尝试过的:



< a href =https://www.google.com/calendar/feeds/default/private/full/ {{event.googleID}}>查看Google< / a>



href如下所示:

https://www.google .com / calendar / feeds / default / private / full / bigstringhere1ovmuup7mjf0



问题是我得到aa 401错误需要授权



如何建立一个链接来查看/编辑基于Google日历ID的日历事件? 解决方案

有一种方法!要查看公共日历活动,请使用以下表单的链接:

  https://www.google.com/calendar/活动?eid = {event-id}& ctz = {timezone} 

其中 { event-id} 是唯一的事件ID,而 {timezone} 这些时区



以下是一个示例:

如果您已编辑了某个公共日历活动,请点击此链接您可以编辑活动并查看来宾列表。否则,您只会看到有关该活动的公开信息。



由于可能难以确定事件ID,因此这里有一个小书签,用于生成Google日历活动的链接当你编辑它的Details页面时:

  javascript:(function(){try {window.prompt('Shareable link to this event:','https://www.google.com/calendar/event?eid ='+ document.getElementsByClassName('ep')[0] .getAttribute('data-eid'))} catch(e){提醒(在编辑其详细信息页面时,使用此小书签可以获取Google日历事件的可分享链接。)}})()

此书签的一个版本适用于新的(截至2017年)Google Calendar UI:

  javascript:(function(){url = window.location.href.split(/); window.prompt('此活动的可分享链接:','https://www.google.com/calendar/ event?eid ='+ url [url.length-1])})()

可能有用l,如何链接到公共Google日历的特定

  https:// www.google.com/calendar/embed?src={calendar-id}&mode=day&dates={yyyymmdd}%2F{yyyymmdd} 

其中 {calendar-id} 是日历的ID, {yyyymmdd}是您要链接的日期。



可选参数包括时区和是否显示各种项目,例如:

   

示例:链接到公共日历的单个日期)。


Using the google calendar API v3, I added an event to a google calendar. Now I want to built an html link so that someone can click and view the calendar event.

Here's what I have tried:

<a href="https://www.google.com/calendar/feeds/default/private/full/{{ event.googleID }}">View Google</a>

the href looks like:
https://www.google.com/calendar/feeds/default/private/full/bigstringhere1ovmuup7mjf0

Problem is I get a a 401 Error "Authorization Required"

How can I build a link to view/edit the calendar event based on a google calendar ID?

解决方案

There is a way! To view a public calendar event, use a link of the form:

https://www.google.com/calendar/event?eid={event-id}&ctz={timezone}

where {event-id} is the unique event id, and {timezone} is one of these time zones.

Here's an example: link to a specific public calendar event.

If you have editing rights to the calendar this event is from, you will be able to edit the event and see the guest list. Otherwise, you just see the public information about the event.

Since it can be difficult to determine the event id, here's a bookmarklet that produces a link to your Google Calendar event when you are editing its Details page:

javascript:(function(){ try { window.prompt('Shareable link to this event:','https://www.google.com/calendar/event?eid='+document.getElementsByClassName('ep')[0].getAttribute('data-eid')) } catch (e) {alert("Use this bookmarklet to get a shareable link to a Google Calendar event when editing its Details page.")}})()

And a version of this bookmarklet which works with the new (as of 2017) Google Calendar UI:

javascript:(function(){ url=window.location.href.split("/"); window.prompt('Shareable link to this event:','https://www.google.com/calendar/event?eid='+url[url.length-1]) })()

(Also possibly useful, how to link to a specific day of a public Google calendar:

https://www.google.com/calendar/embed?src={calendar-id}&mode=day&dates={yyyymmdd}%2F{yyyymmdd}

where {calendar-id} is the calendar's id and {yyyymmdd} is the day you want to link to.

Optional parameters include the time zone and whether to display various items, for example:

&ctz=Asia/Taipei&showNav=0&showPrint=0&showCalendars=0

Example: link to single day of a public calendar.)

这篇关于如何建立到谷歌日历事件的HTML链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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