I AM CALENDAR GOD!
Jun. 12th, 2003 11:27 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Phear my awesome calendar programming power!
(my secret is the perl modeule Date::Calc, but I digress).
For the last 3-4 years I've been maintaining this system which is appropriate for a single group that wants to advertise their events, each event having a big description. You create a file for each event, and include fields so that the software knows how to do the right thing. It generates the "big calendar", the long page of descriptions, and a "next 2 weeks" bullet list teaser that you'll see on our front page. It now generates a weekly newsletter that is emailed out automatically to our Yahoo Group to promote "what's happening this week". Since everything gets generated from the same "database", I don't have to do any work to generate the weekly listing, the newsletter, etc. I don't even have to calculate things like "when is the 3rd monday of the month" because it does all those calculations for me.
But a few months ago I started writing something from scratch that is completely different. It's just made its premier. This lets you maintain a list of events as an MS-Excel spreadsheet. This means that I don't have to do the updates, and that someone with minimal training can do it. I figured out how to add buttons to the MS-Excel spreadsheet so that there is a "save" button, and an "upload" button. Once uploaded to a secret place on my server, it generates a much more simple calendar, but one that is more appropriate for a web site that lists many events... so many that there are many on any given day. This calendar is uploaded to the actual site. It looks like this. (Notice that "today" is in yellow).
What's really neat about this new software is that it generates English sentences based on the columns in the spreadsheet. For example if you look at this page you'd never guess that nearly every sentence of that last entry is completely manufactured based on the fields in the spreadsheet. It turned the code "monthly", "thursday", "2, 4" into "Every 2nd and 4th Thursday of the month". It appended "at 7:30 PM" rather than "between [insert time]" since it knew the time wasn't a range. The last sentence is properly formed with commas in the right places and a single "or".
There are a bunch of other hidden things. Like the fact that if the link is to the same web site the link text isn't "visit their web site", but just "look here". Other sentences change based on if the event is a one-time thing, repeats weekly, or monthly.
God I love it when I get to write code.
no subject
Date: 2003-06-13 08:56 am (UTC)There's a third system that I didn't write, that I highly recommend, called CalendarScript. You can see a real use of it here.
no subject
Date: 2003-06-13 08:58 am (UTC)People in NJ often drive an hour to go to an event. That's typical. It blows me away when people in Santa Clara won't drive to SF for an event.
no subject
Date: 2003-06-13 02:15 pm (UTC)no subject
Date: 2003-06-12 10:19 pm (UTC)no subject
Date: 2003-06-13 09:19 am (UTC)It requires a software package called "remind", and Date::Calc, etc. (and of course, "make" and other unix tools)
I highly recommend you take a look at www.CalendarScript.com since it requires nothing but perl, and lets other people enter events, etc.
no subject
Date: 2003-06-13 03:32 am (UTC)no subject
Date: 2003-06-13 06:24 am (UTC)no subject
Date: 2003-06-13 09:22 am (UTC)Usenix is for systems programming. This is a little web app.
Now my new DNS/DHCP management perl scripts will be submitted to next year's LISA, but that's a different story.