Posted by pete on March 15th, 2007
Actually, it’s the Yankees‘ 2007 schedule, not baseball’s, but, hey, baseball’s nothing without the Yankees…. Anyway, I went looking for the full NYY 2007 schedule in a Google Calendar format yesterday and couldn’t find it anywhere. I found the weekday day games. I found the west coast games. I found the Yankees’ and Mets’ (shudder) day game schedule. I found 2006 schedules and results, but I found no 2007 schedule.
“No problem!” thought I. “I’ll just find an online source, find the right format, some magic happens, then, *Poof!* schedule.”
I created a new gCal, made a few entries, then exported it to iCal (VCAL?) format. Looked around the internets and found a good schedule on the ESPN site. A little cut&paste later and I had a nice, one-game-per-line entry for the month of April. Wash, rinse, repeat for May through September.
Looking through the iCal, I could make out the parts pretty easily. Some of the fields were a little odd, but they didn’t look like anything I needed to bother with. I decided to repeat them verbatim. I whipped up a Python script, knocked out a couple silly bugs, then produced the full, iCal-formatted file. Google Calendar didn’t like importing it.
“No problem!” thought I. “I’ll just tweak some of the vcal…. There.”
“What? Still not importing?”
“Hmmm, OK, I’ll tweak this vcal…. There.”
“What?!?! Freaking vcal! I wonder if Apple’s iCal can read it.”
“Oh, nice. iCal reads it but gCal won’t. Heeeeey…. iCal has an export function…”
And that’s how I wound up — more or less — with a fully public, shared 2007 New York Yankees game schedule.
I think the problem was that every line in the Google Calendar-compatible file needed to be terminated with a ^M (ctrl-M). I still haven’t figured out how to get Python to print a literal ^M character. I thought it involved raw strings, but that didn’t help any. I figure I might have to try Unicode strings and embed the hex value of ^M in the string, but I didn’t know the right value and didn’t want to spend too much more time on the issue, especially since I already had my gCal set up.
Oh, and that program I wrote? I found out later on that I could have just manipulated the schedule files I got from ESPN and saved them as a CSV and imported them. Much less work there. Oh well. Live and learn.