Parse X-WR-CALNAME

124 views
Skip to first unread message

Rutger

unread,
Feb 4, 2011, 5:54:44 AM2/4/11
to RiCal
Hello,
I'm playing with the RiCal gem and I love it. For now just 1 question.
I'm able to parse an ics file and work with elements like cascale,
prodid, method and version by doing cal[0].prodid etc but I can't
access X-WR-CALNAME. I tried something like cal[0].x_properties and
all sorts of combinations with cal[0].x_wr_calname but no luck. Does
anybody know how to access the cal_name?

Regards,

Rutger

Rick DeNatale

unread,
Feb 4, 2011, 7:51:18 AM2/4/11
to rica...@googlegroups.com

cal[0].x_wr_calname SHOULD work. I suspect that you've exposed a bug.

Can you provide a striped down copy of the icalendar data you are
trying to parse?


--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Rutger

unread,
Feb 4, 2011, 8:07:25 AM2/4/11
to RiCal
Rick,
thanks for you swift response. The start of the ics file is:

BEGIN:VCALENDAR
PRODID:-//Markthisdate.com\,0.7
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME: AFC Ajax Eredivisie wedstrijden 2010 - 2011
BEGIN:VEVENT
DTSTART;VALUE=DATE-TIME:20100723T160000Z
DTEND;VALUE=DATE-TIME:20100723T174500Z
URL:http://www.markthisdate.com/a/a
LOCATION:Amsterdam Arena
SUMMARY:Ajax - Chelsea
DESCRIPTION:For more information about this event check http://www.ajax.nl\n\n\nFollow
MarkThisDate on Twitter via
http://twitter.com/markthisdate
CLASS:PUBLIC

Looking at it might be the space before the calname. Shouldn't that
still be parsed correctly?

Regards,

Rutger



On Feb 4, 1:51 pm, Rick DeNatale <rick.denat...@gmail.com> wrote:

Rutger

unread,
Feb 4, 2011, 8:13:05 AM2/4/11
to RiCal
Rick,
I just tried another file without the space and it is still not
parsed.

BEGIN:VCALENDAR
PRODID:-//schedjoules.com,0.7
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Vakantie en Feestdagen Nederland
BEGIN:VEVENT
DTSTART;VALUE=DATE:20110309
DTEND;VALUE=DATE:20110310
URL:http://www.schedjoules.com/
LOCATION:
SUMMARY:Aswoensdag
DESCRIPTION:
CLASS:PUBLIC
TRANSP:TRANSPARENT
STATUS:CONFIRMED
DTSTAMP:20110203T051359
CATEGORIES:Vakantie en Feestdagen Nederland
UID:299...@schedjoules.com
END:VEVENT
END:VCALENDAR

Regards,

Rutger

On Feb 4, 2:07 pm, Rutger <rutgergee...@gmail.com> wrote:
> Rick,
> thanks for you swift response. The start of the ics file is:
>
> BEGIN:VCALENDAR
> PRODID:-//Markthisdate.com\,0.7
> VERSION:2.0
> CALSCALE:GREGORIAN
> METHOD:PUBLISH
> X-WR-CALNAME: AFC Ajax Eredivisie wedstrijden 2010 - 2011
> BEGIN:VEVENT
> DTSTART;VALUE=DATE-TIME:20100723T160000Z
> DTEND;VALUE=DATE-TIME:20100723T174500Z
> URL:http://www.markthisdate.com/a/a
> LOCATION:Amsterdam Arena
> SUMMARY:Ajax - Chelsea
> DESCRIPTION:For more information about this event checkhttp://www.ajax.nl\n\n\nFollow

Rick DeNatale

unread,
Feb 4, 2011, 9:35:34 AM2/4/11
to rica...@googlegroups.com
Ok, I probably won't get the time to look at this until the weekend.

> --
> You received this message because you are subscribed to the Google Groups "RiCal" group.
> To post to this group, send email to rica...@googlegroups.com.
> To unsubscribe from this group, send email to rical_gem+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rical_gem?hl=en.

Rutger

unread,
Feb 8, 2011, 9:00:26 AM2/8/11
to RiCal
Rick,
any chance you looked at this issue? I can parse all the ics fields
except X-WR-CALNAME.

Any help is very much appreciated.

Rutger


On Feb 4, 3:35 pm, Rick DeNatale <rick.denat...@gmail.com> wrote:
> Ok, I probably won't get the time to look at this until the weekend.
>
>
>
>
>
>
>
>
>
> On Fri, Feb 4, 2011 at 8:13 AM, Rutger <rutgergee...@gmail.com> wrote:
> > Rick,
> > I just tried another file without the space and it is still not
> > parsed.
>
> > BEGIN:VCALENDAR
> > PRODID:-//schedjoules.com,0.7
> > VERSION:2.0
> > CALSCALE:GREGORIAN
> > METHOD:PUBLISH
> > X-WR-CALNAME:Vakantie en Feestdagen Nederland
> > BEGIN:VEVENT
> > DTSTART;VALUE=DATE:20110309
> > DTEND;VALUE=DATE:20110310
> > URL:http://www.schedjoules.com/
> > LOCATION:
> > SUMMARY:Aswoensdag
> > DESCRIPTION:
> > CLASS:PUBLIC
> > TRANSP:TRANSPARENT
> > STATUS:CONFIRMED
> > DTSTAMP:20110203T051359
> > CATEGORIES:Vakantie en Feestdagen Nederland
> > UID:2991...@schedjoules.com
> > For more options, visit this group athttp://groups.google.com/group/rical_gem?hl=en.

Rick DeNatale

unread,
Feb 14, 2011, 5:09:04 PM2/14/11
to rica...@googlegroups.com
I've pushed a new version of ri_cal which addresses this.

You should now be able to use cal[0].x_wr_calname

Note however that since I don't in general know if an x property can
have multiple values, this will return a single element array

HTH.

> For more options, visit this group at http://groups.google.com/group/rical_gem?hl=en.

Rutger

unread,
Feb 16, 2011, 2:20:51 AM2/16/11
to RiCal
Rick,
thanks a lot. Version 0.8.8 works great.

Cheers,

Rutger
Reply all
Reply to author
Forward
0 new messages