Sunday, January 24, 2010

Parsing the Google Calendar XML Feed to Create New Calendars and RSS Feeds

We use Google's Calendar as part of our church web page. It's easy to keep up to date and we don't have to install any special calendar software on our server. It even has an extremely sophisticated XML feed. OK, the feed is considerably shorter, if you tweak the call a bit, using Google's published parameters. You can use this feed in an RSS aggregator, informing your readers about what's happening in the near future. But this might not be exactly what you want.

For instance: It's helpful to have a web-page listing of upcoming events, or a customized RSS feed.

This turns out to be relatively easy to do, if you know the trick,

Saturday, January 09, 2010

You know, 1963-1972 was a decade, too

Today's rant is brought to you by the Washington Post's Weekly Free for All. Now FfA actually has many intelligent and thoughtful comments. I read it every week. But FfA has a dark side, as seen at the bottom of the page, where we have yet another writer bemoaning the Post's referring to the ten-year span just ended as the decade. (It's right above the letter suggesting that the Post is trying to destroy the English language by quoting Gilbert Arenas verbatim.)

OK, people, listen up: we're going to set up some rules here:

From now on, there will be two types of Millennia, Centuries, and Decades: the Pedantic and the common.

In the Pedantic system, all counting begins at midnight between 1 BC and 1 AD. Thus a Millennium takes in the years 1-1000, 1001-2000, 2001-3000, … ; Centuries are 1901-2000, 2001-2100, … ; Decades are 1951-1960, 1961-1970, … These names are capitalized.

In the common (or vernacular) system, millennia, century, and decade (all lower-case) are defined by the similarity of the digits forming the years. Thus all the years in a millennium have the same digits except for the last three, in a century all the numbers are the same except the last two, and in a decade only the last digit changes.

Let's show a few examples, OK?

Name of era Years
First Millennium AD 1-1000 AD
First millennium AD 1-999 AD
Twentieth Century AD 1901-2000 AD
Twentieth century AD 1900-1999 AD
First Decade, Twenty-First Century AD 2001-2010 AD
First decade, Twenty-First century AD 2000-2009 AD
Eleventh Millennium BC 11,000-10,001 BC
Eleventh millennium BC 10,999-10,000 BC

(Yes, the First millennium, AD or BC, has only 999 years. Deal with it.)

If all this bothers you, remember your Sesame Street:

One of these things is not like the other, one of these things is not the same:

2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010

Try explaining that all these years are alike to Big Bird.


People giving me a hard time about using BC/AD here will be required to listen to the complete collection of Brit Hume's sermons. Contact Eldrick Woods for more information.