谷歌数据API

发布于 09-01 07:54 字数 377 浏览 6 评论 0原文

两个问题:

如何从特定日历中获取事件?以下链接可获取您主日历的活动:http:// www.google.com/calendar/feeds/[电子邮件受保护]/private/full

如何从使用 ContactsService 时返回给您的 ContactEntry 对象列表中获取联系人的出生日期?

提前致谢!

Two questions:

How do you get events from a specific Calendar? The following link gets events for your primary calendar: http://www.google.com/calendar/feeds/[email protected]/private/full .

And how do you get a contact's birth date from the list of ContactEntry objects that is returned to you when using the ContactsService?

Thanks in advance!

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

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

发布评论

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

评论(1

耶耶耶2024-09-08 07:54:50

我可能应该提供一些我的发现,以防其他人想知道这一点。就从公共日历获取日期而言,CalendarEntry 类包含 AtomLink 对象的通用列表。第一个的 AbsoluteUri 属性将为您提供该日历的 EventEntry 对象。这是一些示例代码:

  foreach (CalendarEntry c in calendars)
  {
    Console.WriteLine(c.Title.Text);
    if (c.Links.Count > 0)
    {
      AtomLink link = c.Links[0];
      EventQuery query = new EventQuery();
      query.Uri = new Uri(link.AbsoluteUri);
      query.FutureEvents = true;

      // Tell the service to query:
      EventFeed calFeed = service.Query(query);
      foreach (EventEntry entry in calFeed.Entries)
      {
        Console.WriteLine(entry.Title.Text);
        foreach (When w in entry.Times)
          Console.WriteLine("\t" + w.StartTime);
      }
    }
    else
      Console.WriteLine("...no data found.");

    Console.ReadKey();
    Console.Clear();
  }

我仍然不知道如何获取联系人的出生日期:/当我有更多时间时我会看看。

I should probably provide some of my findings in-case somebody else wants to know this. As far as getting the dates from public calendars are concerned, the CalendarEntry class contains a generic list of AtomLink objects. The very first one's AbsoluteUri property will provide you with the EventEntry objects for that calendar. Here is some sample code:

  foreach (CalendarEntry c in calendars)
  {
    Console.WriteLine(c.Title.Text);
    if (c.Links.Count > 0)
    {
      AtomLink link = c.Links[0];
      EventQuery query = new EventQuery();
      query.Uri = new Uri(link.AbsoluteUri);
      query.FutureEvents = true;

      // Tell the service to query:
      EventFeed calFeed = service.Query(query);
      foreach (EventEntry entry in calFeed.Entries)
      {
        Console.WriteLine(entry.Title.Text);
        foreach (When w in entry.Times)
          Console.WriteLine("\t" + w.StartTime);
      }
    }
    else
      Console.WriteLine("...no data found.");

    Console.ReadKey();
    Console.Clear();
  }

I still don't know how to get the Contact's birth date :/ I'll have a look at that when I have more time.

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