Welcome Guest, Not a member yet? Register   Sign In
iCalendar feed generation
#1

[eluser]acesfull9[/eluser]
So I have been working for hours on how to create an iCalendar feed.

Here is the dilemma, I can subscribe to remote iCal files just fine, I can keep an up to date iCalendar file on the server that anyone can subscribe to and things work fine, the only thing is I would have to keep that up to date every time an event was changed which could be a huge hassle.

So I figured it would be much easier to just compile one large iCalendar file on the fly. So I have that accomplished, but when I try to import the feed I get a parse error in outlook and sunbird. Which is weird because I can save that file to the server and subscribe to it just fine as described above.

Here is my view, all my controller is doing is loading it.
Code:
<?
$filename="test.ics";
header("Mime-Version: 1.0");
header("Content-type: text/calendar;");
header("method=request;");
header('Content-Disposition: attachment; filename="' . $filename .'"');

?>BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
METHOD:PUBLISH
BEGIN:VEVENT
CREATED:20080319T041317Z
LAST-MODIFIED:20080319T041318Z
DTSTAMP:20080319T041317Z
UID:df89379b-0d66-45ec-9c9d-6ef2a0222a2d
SUMMARY: Test Event2
PRIORITY:5
CLASS:PUBLIC
DTSTART;VALUE=DATE:20080304
DTEND;VALUE=DATE:20080304
TRANSP:TRANSPARENT
DESCRIPTION: TEst Description
SEQUENCE:0
X-LIC-ERROR;X-LIC-ERRORTYPE=VALUE-PARSE-ERROR:Cant parse as DATE-TIME
value in DTSTAMP property. Removing entire property:  20080318T224302Z
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-PT60M
X-MOZ-LASTACK:20080319T041318Z
DESCRIPTION:Mozilla Alarm:  Test Event2
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR

Here is the error I get in sunbird:
[Exception... "Component returned failure code: 0x804a0100 [calIICSService.parseICS]" nsresult: "0x804a0100 (<unknown>)" location: "JS frame :: file:///C:/Program Files/Mozilla Sunbird/js/calIcsParser.js :: ip_parseString :: line 60" data: no]

There is no error description in outlook.

I think the error is somewhere in the header() but I am really not sure. Any help would be greatly appreciated.
#2

[eluser]GSV Sleeper Service[/eluser]
check these
Code:
DTSTART;VALUE=DATE:20080304
DTEND;VALUE=DATE:20080304

those time values don't look quite right




Theme © iAndrew 2016 - Forum software by © MyBB