Google 日历源 - 仅显示今天的活动

发布于 2024-08-08 00:23:02 字数 353 浏览 5 评论 0原文

这是我在 stackoverflow 上的第一篇文章。我的问题是如何更改谷歌日历提要,使其仅自动显示当天的事件?

基本上我想做的是将提要输出到仅显示今天事件的网页上。饲料会每天发生变化。我之前对其他提要(不是谷歌日历)做过类似的事情,除了在这些情况下,我会输出最新的“#”帖子。如果我只显示今天的事件,这是行不通的。

我在雅虎管道上进行了搜索,发现了一些用您必须输入的日期来过滤提要的地方。这是可行的,只是我希望能够使其自动,而不是让别人输入日期。阅读谷歌日历提要API,我也可以做一个日期范围,但这是同样的问题,我必须手动指定范围。有什么方法可以自动化该操作或其他替代方法吗?

我可以做一些 xslt 魔法吗?

感谢您的帮助!

This is my first post here at stackoverflow. My question is how to change the google calendar feed so that it only shows events for the current day automatically?

Basically what I want to do is output the feed onto a webpage that only shows events for today. The feed would change day by day. I've done something similar with other feeds (not google calendar) before except in those cases, I would be outputting the most recent "#" of posts. This wouldn't work if I were to show events for today only.

I've searched around on yahoo pipes and found a few where it filters the feed with a date that you have to input. This works except I want to be able to make it automatic instead of having someone input the date. Reading the google calendar feed api, there's also a date range I can do, but it's the same issue, I would have to specify the range by hand. Is there any way to automate that or some other alternative?

Is there some xslt magic I can do or something?

Thanks for the help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

客…行舟 2024-08-15 00:23:02

您可以在 Yahoo Pipes 中执行此操作:

  1. 从 Google 日历中获取 iCal Feed。 (正如其他人评论的那样,Google 日历提供的 Atom 提要似乎没有以合理的结构化格式包含事件日期。)
  2. 根据 DTSTART/DTEND 值过滤提要。您可以使用 Date Builder 模块获取当前日期,只需输入“今天”作为日期。

示例管道(仅显示未来 24 小时内开始的事件) :

iCal 接下来 24 小时

You could do this in Yahoo Pipes:

  1. Fetch the iCal feed from your Google calendar. (As others have commented, the Atom feeds that Google calendar provides do not seem to contain the event date in a reasonably structured format.)
  2. Filter the feed based on DTSTART/DTEND values. You can use the Date Builder module to get current date, just enter "today" as the date.

An example pipe (shows only events starting within the next 24 hours):

iCal next 24 h

喵星人汪星人 2024-08-15 00:23:02

这是由 gdata 的示例给出的

private static void dateRangeQuery(CalendarService service,
  DateTime startTime, DateTime endTime) throws ServiceException,
  IOException {
CalendarQuery myQuery = new CalendarQuery(eventFeedUrl);
myQuery.setMinimumStartTime(startTime);
myQuery.setMaximumStartTime(endTime);

// Send the request and receive the response:
CalendarEventFeed resultFeed = service.query(myQuery,
    CalendarEventFeed.class);

System.out.println("Events from " + startTime.toString() + " to "
    + endTime.toString() + ":");
System.out.println();
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
  CalendarEventEntry entry = resultFeed.getEntries().get(i);
  System.out.println("\t" + entry.getTitle().getPlainText());
}
System.out.println();

},

其中我认为您可以将最小时间和最大时间设置为同一天?

this is given by the sample of gdata

private static void dateRangeQuery(CalendarService service,
  DateTime startTime, DateTime endTime) throws ServiceException,
  IOException {
CalendarQuery myQuery = new CalendarQuery(eventFeedUrl);
myQuery.setMinimumStartTime(startTime);
myQuery.setMaximumStartTime(endTime);

// Send the request and receive the response:
CalendarEventFeed resultFeed = service.query(myQuery,
    CalendarEventFeed.class);

System.out.println("Events from " + startTime.toString() + " to "
    + endTime.toString() + ":");
System.out.println();
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
  CalendarEventEntry entry = resultFeed.getEntries().get(i);
  System.out.println("\t" + entry.getTitle().getPlainText());
}
System.out.println();

}

in which i think you can just set the minitime and maxtime to the same day?

落在眉间の轻吻 2024-08-15 00:23:02

您要做的就是设置 Atom feed 的 url 参数——start-min 为今天,start-max 为明天——另外,请注意,您需要经过身份验证才能使其正常工作。

What you do is set the url parameters for the atom feed -- start-min to today and start-max to tomorrow -- also, note you'll need to be authenticated in order for this to work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文