home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / cgi-bin / Japan / KDD / nph-switch < prev    next >
Text File  |  2017-09-21  |  1KB  |  39 lines

  1. #!/usr/local/bin/perl
  2.  
  3. $|=1;
  4.  
  5. $year_day = (localtime)[7];    # days of year
  6. $first_day = 94;        # first day of seimei (April 4)
  7. $moon_day = $year_day - $first_day + 1;    # day of sekki
  8. # $moon_day = 48;            # for DEBUG
  9.  
  10. @sekki = ('seimei','koku-u','rikka','shouman','boushu','geshi','shousho',
  11.       'taisho','risshu','shosho','hakuro','shubun','kanro','soukou',
  12.       'rittou','shousetsu','taisetsu','touji');
  13. @dsekki = (16,15,16,15,16,16,15,16,16,15,16,15,15,15,15,15,14,10);
  14.  
  15. $csekki = 0;            # sekki counter
  16. $cmoon_day = $moon_day;        # moon day counter
  17.  
  18. while ($cmoon_day > 0) {
  19.     $cmoon_day = $cmoon_day - $dsekki[$csekki];
  20.     $csekki = $csekki + 1;
  21. }
  22.  
  23. $dir = $sekki[$csekki - 1];
  24. $month_html = join('',"SEKKI/",$dir,"/INDEX.html");
  25.  
  26. # print "$month_html\n";        # for DEBUG
  27.  
  28. print "HTTP/1.0 200 Okey\n";
  29. print "Content-type: multipart/x-mixed-replace;boundary=sometext\n";
  30. print "\n";
  31. print "--sometext\n";
  32. print "Content-type: text/html\n";
  33. print "\n";
  34. open (S, "$month_html");
  35. print (<S>);
  36. close S;
  37. print "\n";
  38. print "--sometext--\n";
  39.