gpt4 book ai didi

java - 谷歌日历java API

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:19:58 25 4
gpt4 key购买 nike

我有一个 CalendarEntry 对象

我知道 http://www.google.com/calendar/feeds/example@gmail.com/allcalendars/full 是所有日历的 feed url

但是我如何从 CalendarEntry 实例中获取这个提要 url?

因为我想在指定的日历中发布新条目并且我需要这个 url。

谢谢!

最佳答案

我建议您在代码中指定该 URL,如以下代码段:

CalendarService myService = new CalendarService("CalendarService");
myService.setUserCredentials("example@gmail.com", "yourPassword");
URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/allcalendars/full");
CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class);
System.out.println("Your calendars:");
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
CalendarEntry entry = resultFeed.getEntries().get(i);
System.out.println("\t" + entry.getTitle().getPlainText());
}

CalendarEntry 实例将存储通过指定 URL 检索到的每个日历(主日历、辅助日历、导入日历)。

关于java - 谷歌日历java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1928549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com