Sunday, May 21, 2006

I Swear I Fixed It This Time

If you read the comments about GCalQuickTab, then you'll notice that I have a lot of unsatisfied customers, and I admit that they have a right to be upset because GCalQuickTab 0.3 makes it easy to unintentionally open Google Calendar while composing an email. Most users probably think I'm a moron, but I assure you that it's not that simple...

When you type the letter L in Gmail, GCalQuickTab tries to figure out if you are trying to enter text in a box, or if you are trying to activate the GCalQuickTab shortcut for Calendar. Unfortunately, the heuristic that I was using to make this distinction involved checking frame names, but then the names of the frames in Gmail changed, breaking my extension. I just submitted GCalQuickTab 0.3.1 which has a more robust heuristic -- it traverses the DOM and looks for a document in design mode, which would reflect that Gmail's rich content editor is open and that the user is probably trying to type an L in his email, in which case Google Calendar will not be opened.

Unfortunately, there are often a lot of extensions in the queue to be reviewed, so I'm not sure when version 0.3.1 will hit the Mozilla Update site. For example, version 0.3 took a little over a week to be approved, so 0.3.1 may also take some time. I feel bad for those of you who are still using ones instead of Ls in your email, so in the interim, so I am posting GCalQuickTab 0.3.1 on bolinfest.com. The updateURL for the extension still points to Mozilla Update, so even if you download GCalQuickTab from bolinfest.com, you will still get future updates to the extension.

Sunday, May 7, 2006

The Long-Awaited GCalQuickTab 0.3

If you still have GCalQuickTab installed (thank you!), then you'll be happy to know that I think I fixed the keyboard shortcut for real in version 0.3, which is pending approval right now. And even if I didn't fix the bug, at least I now provide the option to disable the keyboard shortcuts, or to define your own keyboard shortcuts if you have a problem with the defaults (G for Gmail and L for caLendar). Unfortunately, I was too lazy to build a UI for these preferences, so you'll have to go to about:config and filter by "gcalquicktab" to set the keycodes to your liking (or to -1 to disable them).

Saturday, May 6, 2006

Some Screen-Scraped Calendars for Google Calendar

I noticed that there are some concert calendars for concerts in the Bay Area that do not have calendar feeds that you can overlay in Google Calendar. So sad. I decided to do some screen-scraping to create calendars for them.

I wanted to write something that would automatically screen-scrape the concert web sites once an hour. Unfortunately, since I don't know how to run Firefox headless (i.e., a Chickenfoot with its head cut off), I had to use something other than Chickenscratch, which is unfortunate because it turned out that doing it in Python was more tedious (JavaScript has better utilities for working with the DOM, and it's nice to be able to use literal regexps instead of having to "compile" them.)

I struggled for awhile to get mod_python working so I could serve a PSP or something that would generate the .ics on the fly, but that failed, so I decided to schedule a Python script with cron that would generate the .ics once an hour. Since I was no longer in Chickenfoot, I needed something besides Firefox to be a fault-tolerant HTML parser, and fortunately I found xml.dom.ext.reader which worked just fine.

I hit a pretty serious snag, though, when I discovered that my server has Python 2.2 instead of 2.4. I didn't think that it would be a big deal that I didn't have the latest version of Python; however, it turns out that date handling in 2.2 is abysmal. Instead of trying to figure out how to upgrade Python (since trying to install mod_python was so much fun), I found an open-source project that implemented the Python datetime library, so I had to download that and extract the appropriate file. Despite what I read about the backport, the implementation of pythonweb's datetime.py was far from complete (it implements the complete API, but its implementation raises many "not supported" exceptions). Nevertheless, I got things working (there are still some TODOs in the code where things could be improved), so I hope you check out the code and overlay my calendars on your Google Calendar.