xcalendar.cgi - XCalendar Compatible CGI/PostScript Calendar

Copyright (C) 1999-2001 Taiji Yamada, Jun Takahashi and Shunsuke Horai

[Back] [Japanese Page]


On XCalendar, calendar with a notebook for X11, we'd like to browse our notebook of XCalendar via HTTP. Now, we made a CGI script ``xcalendar.cgi'' to show a calendar with a notebook of XCalendar. This script is written in Perl5.

In the package, there are xcalendar.cgi and xcalendar-j.cgi. The xcalendar-j.cgi shows a calendar in Japanese, and xcalendar.cgi shows in English. They are the same program by symbolic link, and xcalendar.cgi changes the language depending upon its own name.

screen shot
xcalendar.cgi screen shot

xcalendar.cgi without arguments shows a calendar of the current month, and also shows a content of your notebook on this day if it exists. The link on '>' and '<' are to browse the next and previous month, respectively. The day printed with a link has a content on the day. If you follow this link of the day, you can browse its content.

But, If you want to browse your notebook of XCalendar, you have to execute the following procedure. In the directory ``~/public_html/private/'' in where this script is installed,

% cd ~/public_html/private
% ls
xcalendar-j.cgi@ xcalendar.cgi*
% ln -s ~/Calendar .
% chmod go+rx ~/Calendar
If you can not permit that your personal notebook is readable for another person, you also should write .htaccess file of this directory appropriately. If you consider this permission by .htaccess of your web server an incomplete prescription, you should not execute above mentioned procedure and you'd better to abandon reading a notebook of XCalendar via HTTP.

[5/12/2000] Since version 0.999, xcalendar.cgi supports such mobile access technologies as following types:

On mobile access to xcalendar.cgi via WAP, if your handheld device can't get the document in HDML, please check the subroutine to automatically detect whether WAP devices or not, in the source code of xcalendar.cgi:
sub is_hdml {
  if ($ENV{"HTTP_USER_AGENT"} =~ /^UP.Browser/i) {
  else {


xcalendar.pl prints a calendar in PostScript. The current version supports English and Japanese PostScript printing. The script changes languages to print depending upon the value of the environment variable LANG.

You can print a calendar with your own holiday data on various types of papers. About holiday data, see also xcalendar(1) and my patch for personal holiday data for XCalendar. I use the output of xcalendar.pl for calendar in my pocket notebook. In Japan, bible-size, mini-size and pocket-size papers are popularly used for pocketbooks.

For usage, please see following examples of calendars of the year 2000. For more details, please read `-help' of xcalendar.pl.


Year 2000, Letter size, Color
% xcalendar.pl -paper=letter -color 2000 | lp

Year 2000, Legal size, Landscape, Monochrome
% xcalendar.pl -paper=legal -landscape -mono 2000 | lp

Year 2000, Pocket size [76x126(mm)], Color
% xcalendar.pl -paper=pocket -color 2000 | lp

Year 2000, Saddle-type fold of Bible size [95x170(mm)], Color, lines along which to cut off
% xcalendar.pl -paper=bible2 -fold=saddle -cutline -color 2000 | lp

Year 2000, Saddle-type fold of Mini size [80x126(mm)], Monochrome, lines along which to cut off and to fold
% xcalendar.pl -paper=mini2 -fold=saddle -cutline -foldline -mono 2000 | lp

1999 Calendar for our office


xcalendar.cgi and xcalendar.pl is the same program and it changes purposes depending upon its own name. For use of this script via CGI, though I wrote this script with the greatest possible care to security, you should handle with care of the location and the permission of this script and the limitation to access by .htaccess file.

Questions or comments regarding this service? taiji@aihara.co.jp

Copyright (C) 1999-2001 Taiji Yamada, All rights reserved.