This is a CGI script that displays my monthly calendars
on the web. The real script is hidden behind a passworded
directory. (I don't want to share my entire schedule, sorry.)
But a sample page can be seen here.
In actual use, it runs on my workstation's web server.
If the script receives year and month CGI query
and can make sense out of them as an actual year and month,
it will display that month's calendar. Otherwise the current month
It's a good example of how mediocre programming skills
can glue together very hard work from smarter people
into something kind of useful.
So the idea is: use the CGI module to extract the query parameters;
use the Date::Manip stuff to parse them and figure out the
appropriate arguments for the remind program and the
rem2html script; call the CGI routines further to
wrap the output in the desired format.
Most important is the remind program from
Roaring Penguin Software. It's in the grand tradition of Unix tools:
plays well with other programs, a wealth of commandline options,
a daunting array of features, a very helpful and smart user community.
The datafile format is "almost" a programming language, allowing
very flexible scheduling of repeating events.
There's a remind RPM available for Fedora, and that's what I
installed. I also installed a 'remind-gui' RPM which contains
a (self-described) "cheesy" graphical front end. Although
I don't use this in production, it was helpful in figuring
Included in the remind RPM is the Perl script rem2html
which produces monthly calendars from the remind output.
It's a CGI, so of course we use Lincoln Stein's CGI
Perl module. This is available as a Fedora RPM.
Also useful are the date manipulation routines in the
Perl module. This is available as a Fedora RPM. Most of the
"real work" done by the CGI itself are calls to Date::Manip
For stylistic reasons, I also use the Perl
version Modules. Also available as Fedora RPMs, and it's also pretty easy to dink
the code to not use them.
That's simple enough that almost certainly
other folks have done this
exact same thing. But I couldn't
find one anywhere.
I like this solution, because it's
one-click available from a web browser anywhere
via a bookmark; I don't need to be sitting anyplace
special, or run anything extra.
A number of things are hard-coded into the CGI script:
- The location of various executables, most notably the
rem2html script. This will probably change if
there's a version upgrade to remind.
The location of my remind data file. Also note that
this file (and any files it includes) has to be readable
by the webserver, which has obvious implications for privacy.
You can jump to a particular month/year by choosing from a couple
of popup menus. The year range is calculated from the previous year
through three future years.
I gussied things up a bit with a style sheet which
is pretty easy to play with.
Last modified: September 7 2012 09:00 EDT
Paul A. Sand,