white space
#00 [foussin分室] ... [ <<:home (index.html)] ... [ <<:top (top.cgi)]
....... [here: 編集後記] [フレーム解除] ... [ >:next (編集後記の編集後記)]
#!/usr/local/bin/perl

=PostScript (updated: 2010.06.20 Sun 21:26 JST)


         !()
         ---------------------------------------
         2024.05.19 Sun 20:40:31 ()
         ---------------------------------------
         2024.05.19 Sun 11:40:31 GMT()
         ---------------------------------------
         2024.05.19 Sun 06:40:31 (New York)
         ---------------------------------------


                        

 ! 

 
 CGI 使 

       
        

 foosanfoussin
 CGI 
使
 !
   jpway.pl   greg_calc.pl   outf.pl    3 
使  
CGI 使


         
       

 1





          
          

 


CGI 使
 CGI 

 
 CGI 


         Perl 
=cut

# "postscript.cgi" by foussin
# 2010.06.20 Sun 21:26
#           [(2)]
# 2010.06.13 Sun 08:06
# 2008.07.21 Mon 22:14 - 2008.07.30 Wed 11:17
#-------------------------------------------------------
#  & 
#-------------------------------------------------------
    print "Content-type: text/html\n\n";
    chdir;            #  go to home
    chdir './cgi';    # CGI 
    require 'jpway.pl';    # 1
    require 'greg_calc.pl';# 
    require 'outf.pl';     # 
    &jpway::init('jcode');
    &greg_calc::init_outf('ymd.');

#-------------------------------------------------------
# 
# (yyyy.mo.dd Day hh:mi:ss [GMT])
#-------------------------------------------------------
# GMT
    ($gmt_csv, $jst_csv) = &greg_calc::both_time(time);
    $jst = &greg_calc::outf($jst_csv);  # -9
    $gmt = &greg_calc::outf($gmt_csv);  #  0
    $jst .= '()';   $gmt .= '()';
# 
    &greg_calc::set_tzone("EST5EDT", "keep");
    $nyk_csv = &greg_calc::mold("now");
    $nyk = &greg_calc::outf($nyk_csv);  # +5
    $nyk .= '(New York)';
    &greg_calc::set_tzone("JST-9", "keep"); # JST 

#-------------------------------------------------------
# 
#()
#-------------------------------------------------------
# $jst 
    $jst =~ /\s(\d+):\d+:\d+/;   $hr = $1;    $mes = '';
# ()
# 04:00 - 06:59 ... (darkside)
# 07:00 - 10:59 ...   (daylight)
# 11:00 - 15:59 ...   (daylight)
# 16:00 - 18:59 ... (darkside)
# 19:00 - 03:59 ...   (darkside)
    ($hr > 3 and $hr < 7) &&
            ( $mes = '!()' );
    ($hr > 6 and $hr <11) &&
            ( $mes = '!()' );
    ($hr >10 and $hr <16) &&
            ( $mes = '!()' );
    ($hr >15 and $hr <19) &&
            ( $mes = '!()' );
    $mes || ( $mes = '!()' );
# ()
# 
# 07:00 - 15:59 ... (normal)
# 16:00 - 06:59 ...     (darkside)
    $css  = '';
    if ($hr > 6 and $hr < 16) { ##  ##
        $css  = 'normal.css';
        $bg   = '#cccccc'; # 
        @color= ("bb","cc","dd","ee","ff","ff");
    } else { ##  ##
        $css  = 'darkside.css';
        $bg   = 'black';   # 
        @color= ("77","88","99","bb","dd","ff");
    }
# ( 4)
# 04:00 - 06:59 ... (dawn)
# 07:00 - 15:59 ... (daylight)
# 16:00 - 18:59 ... (magic_hour, twilight, dusk)
# 19:00 - 03:59 ... (night_view, neonlights)
#   ()
    $bg_img = '';
    ($hr> 3 and $hr< 7) && ($bg_img = 'dawn.jpg');
    ($hr> 6 and $hr<16) && ($bg_img = 'daylight.jpg');
    ($hr>15 and $hr<19) && ($bg_img = 'twilight.jpg');
    $bg_img || ($bg_img = 'neonlights.jpg');

#-------------------------------------------------------
# (2)(2010.06.20 Sun )
# 
#-------------------------------------------------------
    $twin  = int(rand(4));    ($twin == 1) && ($r = 0);
   ($twin == 2) && ($g = 0);  ($twin == 3) && ($b = 0);

#-------------------------------------------------------
# (outf.pl)
#-------------------------------------------------------
&outf::def("jst gmt nyk mes", $jst, $gmt, $nyk, $mes);

#-------------------------------------------------------
# html [1]
#-------------------------------------------------------
print <<"EOSTR";
<!DOCTYPE HTML PUBLIC
    "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja"><head>
<meta http-equiv="Content-Type"
    content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel=stylesheet type="text/css" href="../$css">
<title>foussin ... </title>
<meta name="Author" content="foussin">
<meta name="Keywords"
    content="cgi,perl,japanese,post,script">
<meta name="Description"
    content="This page is Post Script in foussin's site">
<link rel="index" href="../index.html">
<style type="text/css">
<!--
body {
    background-image:
    url(../image/$bg_img);
    background-color: $bg;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: scroll;
}
-->
</style></head>
<body>
<div><a name="00"><img
    src="./ct-top/wwwcount_pa.cgi?hide+space.gif"
    width=3 height=3 alt="white space"></a></div>
<div class=border-red><div class=size-1>
    #00 [foussin] ...
    [<a target="_top" href="../index.html">
        &lt;&lt;:home (index.html)</a>] ...
    [<a target="_top" href="./top.cgi">
        &lt;&lt;:top (top.cgi)</a>]<br>
    ....... [here: ]
    [<a target="_top"
        href="./postscript.cgi"></a>]
    ... [<a href="./sub/memo.html">
        &gt;:next ()</a>]
</div></div>
<div class=bldg>
EOSTR

#-------------------------------------------------------
# 1(CGI )()
#-------------------------------------------------------
$file = "postscript.cgi";
($ihandle) = &jpway::classify("IN", $file);
open($ihandle, "<$file") or die;
($euc_zenkak, $code) = &jpway::anyway_euc(" ");
($hr< 7 or $hr>15) && ($night = 1); # 
$night && (print "<pre>");
while (<$ihandle>) {
    $end && last;
    chomp;
    unless ($night) { # 
        $_ || next;
        ($_ =~ /^/ or $_ =~ /^/) && next;
        ($_ =~ /^\s*#?\-+$/) && next;
        ($_ eq "__END__" ) && ($end = 1);
    }
    $line = &outf::conv($_);
    ($euc_line, $code) = &jpway::anyway_euc($line);
  # 1($color[0]  $color[5])
  # &read_euc 使 jpway.pl  require 
    @euc_line = &jpway::read_euc($euc_line);
    @euc_html = ();    $htm = "";    $cc = "";
    foreach $j (@euc_line) {
      # (,)(up)
        if ($j eq " "  or  $j eq $euc_zenkak) {
            $htm = $j;
        } else {
            $j =~ s/&/&amp;/g;
            $j =~ s/</&lt;/g;
            $j =~ s/>/&gt;/g;
          #  RGB 
          # <span style="color:#rrggbb;">$j</span>
            ($twin == 1) || ( $r = int(rand(6)) );
            ($twin == 2) || ( $g = int(rand(6)) );
            ($twin == 3) || ( $b = int(rand(6)) );
            $rgb= "#$color[$r]$color[$g]$color[$b];";
            $htm= "<span style=\"color:$rgb\">$j</span>";
        }
        @euc_html = (@euc_html, $htm);
    }
    $euc_line = join("", @euc_html);
    $line = &jpway::restore($euc_line, $cc, $code);
  # 
    $night || ($line = "<pre class=window>$line</pre>");
    print "$line\n";
}
close($ihandle);

#-------------------------------------------------------
# html [2]
#-------------------------------------------------------
$night && (print "</pre>"); # 
print <<"EOS";
</div><div class=border-red><div class=size-1>
    [<a href="#00">&lt;:head #00</a>] ...
    [<a target="_top" href="../index.html">
        &lt;&lt;:home (index.html)</a>]
    [<a target="_top" href="./top.cgi">
        &lt;&lt;:top (top.cgi)</a>]
        [<a href="./sub/memo.html">
        &gt;:next ()</a>]
</div></div></body></html>
EOS

__END__

  2
(.css) 4使 CGI


       
       

 
使foussin 
 ?


[<:head #00] ... [ <<:home (index.html)] [ <<:top (top.cgi)] [ >:next (編集後記の編集後記)]