Thursday, March 29, 2007

MLB 2007 Schedules for Google Calendar

I wrote a Chickenfoot script to generate the 2007 Major League Baseball schedules from mlb.com. Instead of putting the schedules directly into Google Calendar, I posted them on wikicalendars.com. Just visit the site, click on your favorite team (let's go Mets!), and click on the "Google Calendar" button above the calendar preview to add the schedule to your Calendar account (or click the iCal icon to add it to Apple iCal).

Subscribe to New York Mets 2007 Schedule from wikicalendars.com



But wait, "What is wikicalendars.com?" you wonder. I realized that I forgot to post about it before, so I should explain. Last fall, I wrote about how I created mitcalendars.com with Mike Lambert to make it easy to add MIT course schedules to Google Calendar. After getting feedback from students, we realized that there were two major issues with our site:


  • Students could not update or correct the calendars we had auto-generated.
  • We had to guess which permutations of calendars for a course we should generate: if there are 2 lecture choices , 8 recitation choices, and 3 lab choices, should we generate 48 calendars for the course? How do we present all 48 options a to user?


To address the first issue, we decided to store the calendar data in a wiki so that anyone on the web could update it. This way, if a class were rescheduled, or if a final exam were added, anyone from the class could adjust the course's calendar accordingly. Obviously spam would be a concern, so we decided to go with the ever-popular MediaWiki, since we assumed that Wikipedia has more experience with spam than anyone, so they likely have the best tools to combat it. Also, because it was open-source, it was easy for Mike and I to hack it up as we needed.

To address the second issue, we added a feature called "calendar splice" that enables you to combine multiple calendars from wikicalendars.com to dynamically create a new calendar. This way, we could create a calendar for each lecture and recitation offering for a course, but leave it up to the students to combine a lecture and recitation into one calendar. Unfortunately, this is not obvious from the wikicalendars.com user interface yet, but the feature is there. (Incidentally, we offer a number of output formats for calendar data, facilitating the use of wikicalendar data in mashups, etc.)

Because we wanted to make it as easy as possible to edit calendar data, we decided that we needed to create our own wiki-language for the site. Here's a snippet from the NY Mets 2007 calendar:

__CALENDAR__
CalendarName: New York Mets 2007 MLB Schedule
CalendarTimezone: America/New_York
CalendarURL: http://mlb.mlb.com/schedule/sortable.jsp?c_id=nym

DefaultEventDuration: 3h

EventWhen: 4/1/2007 8:05pm
EventWhat: Mets vs. Cardinals (Away)
EventWhere: Away

Unfortunately, unlike WikiMedia's wiki-language, our format strongly favors English speakers -- especially those who use American date and time formats. Though we were not thrilled with this decision, we felt it was acceptable for our first version of the site. We tried to focus on simplicity, and I think many will agree that 4/1/2007 8:05pm is much simpler for the average person to work with than 200704012005/200704012305. The calendar syntax is documented in detail on the web site.

So given all of this, what makes a good wikicalendar? Arguably, any calendar whose events come from a community of people rather than from one well-defined leader. For example, I started a calendar for release dates of Wii games which would ideally take contributions from those who troll gaming rumor boards and web sites. (I would love to see people start contributing!) I also created a calendar to track when NYC Marathon qualifier races are, as there are many of us who aren't interested in the non-qualifier races. I try to keep the calendar fairly up-to-date myself, but if I fall behind, hopefully another calendar subscriber will notice and pick up the slack!

Which brings me to why I decided to store the MLB calendars on wikicalendars.com: though the schedule data is correct now, the baseball season is subject to rain outs and reschedulings, and I can't stay on top of all of those changes, but Time's Person of the Year can! This is, in many ways, an experiment. Will anyone keep these calendars up to date? Will they lie dormant and become inaccurate, or even worse, become littered with spam? I guess we'll see!

2 comments:

  1. [...] Not too long ago, I imported MLB schedule data into WikiCalendars.com. This made it simple to see when the Mets were playing next, but not where they would be playing next, so I decided to create CalMap: a mashup that takes a calendar feed and plots the locations of the events on a map: [...]

    ReplyDelete
  2. Hey guys! We are the best paper writer service in the market with a quality assurance department team comprising qualified editors who check each order thoroughly before delivery to the client. Submitting meticulous papers to your professor is mandatory in attaining exceptional grades. Hence, we ensure that you get the best.

    ReplyDelete