Tuesday, March 24, 2009

It's time to add baseball schedules to Google Calendar!

It's not very flashy, but I created a Google Calendar for each MLB team's 2009 schedule:

http://mlb.bolinfest.com/

Each calendar will be updated automatically – I have a script that runs twice an hour while baseball games are on (it gets a break from 3am-noon eastern time) to scrape the latest data and update all of the calendars. Unfortunately, I don't think the calendars will be re-indexed that quickly by Google Calendar, but it's better than nothing.

I actually wrote Chickenfoot code two years ago to scrape data from mlb.com for use with CalMap and wikicalendars.com. Unfortunately, I never quite got Chickenfoot working with cron (which meant I manually ran the Chickenfoot script every morning to update the calendars), so this year I actually decided to run my original JavaScript code using Rhino since it's easy to kick off a Java process using cron. It sounds a little crazy, but it works great!

3 comments:

  1. Hi,

    I've been trying to embed a mini Google Calendar on my website. I have come across a widget that you have made http://gmodules.com/ig/creator?synd=open&url=http://www.google.com/ig/modules/calendar-for-your-site.xml

    I love it, except for that the event time in the pop up window is displayed in a wrong time zone (I think it's GMT 00:00) for non-Google users. Is there anything that I'm not doing correctly?

    I'm sorry to communicate to you by posting a comment on you blog, but I could not find your email address anywhere on this blog. I would really appreciate it if you could give me some advice as to how to fix the time zone problem.

    Regards,

    Sumi

    ReplyDelete
  2. First - thanks! I wish I had discovered your Google calendar MLB schedules before the season started. Are you planning to do these again for 2010?

    - Is your script still running? If so, what gets updated? ... the game scores?

    ReplyDelete
  3. Guess I wasn't observant enough about the game score updates. Great job. And, thanks again.

    ReplyDelete