Is there any open iCalender API? [closed]

泪湿孤枕 提交于 2019-12-19 02:38:22

问题


Is there any API that I can use and post event data to (for example with querystrings) and get back a file that the visitor can download and add to his calender?

I can of course write the script myself, but if there is a open API I could save some time.


回答1:


You could use iCal4j




回答2:


You asked for a webservice of some sort, and I do not know of one, but if you are using .NET, you can create your own using this library:

http://www.codeproject.com/KB/vb/vcalendar.aspx




回答3:


Maybe it's an option for you to generate and send an e-mail to the user containing the appointments you want the to add. By doing this you:

  • Haven't jo use any API
  • Use the build in auto-parsing feature of Apple Mail (Mac OS & iOS)
  • Stay compatible to other users which might not use iCal



回答4:


I just used DDay.iCal which works fine for C#. You can see some documentation here on how to read/parse from an .ics file, and this is what i used to create a new file, checked it works on Outlook and on the iOS email application:

public static string GetCalendarAsString(string subject, DateTime start, DateTime end, 
                                         string location, string timeZoneName)
{
    var calendar = new iCalendar();
    var timeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneName);
    calendar.AddTimeZone(iCalTimeZone.FromSystemTimeZone(timeZone));

    var evt = new Event
              {
                  Start = new iCalDateTime(start),
                  End = new iCalDateTime(end),
                  Location = location,
                  Summary = subject,
                  IsAllDay = false
              };

    calendar.Events.Add(evt);

    var serializer = new iCalendarSerializer();

    return serializer.SerializeToString(calendar);
}

you can use several other properties, although I only needed these




回答5:


You can download iCal4J using http://sourceforge.net/projects/ical4j/files/iCal4j/1.0/ical4j-1.0.zip/download



来源:https://stackoverflow.com/questions/6595683/is-there-any-open-icalender-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!