As part of the Leeds Music Scene website I’ve been working on the events section a little recently. Promoters, venue owners and bands submit their listings over at another site I run (Leeds Gig Guide) and these are then made available to the LMS site where I have band profiles, venue details, etc. The two complement each other nicely.
Each gig now has its own page on the LMS site and I can incorporate a variety of useful bits of information into it, such as venue location (using the Google Maps API) and ticket links.
My next project was to add an “Add To Calendar” option.
My target Calendar applications were Google Calendar, Yahoo! Calendar and 30boxes, as well as the desktop Calendars such as iCal and Outlook.
Google Calendar
Google has its own “Add to Google Calendar” help page, so this was relatively simple. For the event title I chose to go with the format “bandname @ venue”, with the description being the full list of bands playing. I used the date of the gig for the start and end date with an arbitrary 19:00 chosen for the time (format is 20060904T190000Z).
Here’s a simple breakdown:
http://www.google.com/calendar/event?
action=TEMPLATE
&text=BANDNAME @ VENUE
&dates=STARTDATE/ENDDATE
&location=VENUE
&details=FULL BAND LIST
&trp=false
&sprop=LINK TO LMS GIG PAGE
&sprop=name:LEEDS MUSIC SCENE
The only issue I have with Google Calendar is that it appears to choose at random what time zone to use. On three tests of the same file, it interpreted the start and end time as 7pm-7pm (as expected), 7pm-8pm (not intended) and 8pm-8pm (nor was this). Still, given the start time was just chosen at random anyway this makes little difference to me.
Yahoo! Calendar
Adding an event to Yahoo! Calendar was a little more tricky, and there’s nothing at all on their Developer help pages. A bit of searching found a similar request for help on a forum and eventually I uncovered this (start time is the same as per Google).
http://calendar.yahoo.com/?
v=60
&DUR=0400
&TITLE=BAND @ VENUE
&ST=STARTTIME
&in_loc=VENUE
&DESC=FULL BAND LIST
&URL=LINK TO LMS GIG PAGE
iCal and .ics
In order to create “Add this gig to your calendar” for iCal, Outlook and 30boxes I needed to create a VCALENDAR event. The RFC2445 Syntax Reference for this wasn’t written for a beginner, and unfortunately the related reference page at Wikipedia is likely to be deleted.
Luckily, it was there when I needed it and I came up with the following.
BEGIN:VCALENDAR
PRODID:-//LEEDS MUSIC SCENE//EN
VERSION:2.0
BEGIN:VEVENT
SUMMARY:BAND @ VENUE
PRIORITY:0
CATEGORIES:GIG
CLASS:PUBLIC
DTSTART:STARTTIME
DTEND:ENDTIME
URL:LINK TO LMS GIG PAGE
DESCRIPTION:FULL BAND LIST
LOCATION:VENUE
END:VEVENT
END:VCALENDAR
For 30boxes you give it the link to an .ics file via the webcal:// protocol …
http://30boxes.com/add.php?webcal=webcal://LINKTOICALFILE
iCal takes either the webcal:// protocol (subscribe to the event) or if you offer it over a http:// the Mac will download the file, trigger iCal and add the event for you. I tested this one afternoon in Sheffield Meadowhall’s Apple Store!
Lotus Notes works too, you need to download the .ics file to your desktop then manually drag it into the Notes Calendar. It then sends an invite from you, to you, which you add to your calendar. Works a lot easier than it sounds.
And there you have it, the ability to add forthcoming Leeds gigs into your calendar.