package plugin::jikokuhyou::Jikokuhyou; use strict; sub new { my $class = shift; my $self = {}; return bless $self,$class; } sub paragraph { my $self = shift; my $wiki = shift; my $source = shift; my ($sec, $now_min, $now_hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time()); my $buf = ''; my $page = $wiki->get_page($source); if ($page eq ''){ return &Util::paragraph_error("Page($source) not found."); } my @lines = split("\n", $page); my $line = ''; do { $line = shift @lines; } while (!($line =~ /^,/)); $buf .= "
$hour | "; $buf .= ""; foreach my $m (split(' ', $minutes)) { my $bold = 0; my $us = 0; if ($m =~/\*(.+)/) { $m = $1; $bold = 1; } my $now = $now_hour*60 + $now_min; my $t = $hour*60 + $m; if ( ($now <= $t) && ($t < $now + 30 )) { $us = 1; } $buf .= '' if ($us == 1); $buf .= '' if ($bold == 1); $buf .= $m; $buf .= '' if ($bold == 1); $buf .= '' if ($us == 1); $buf .= ' '; } $buf .= " | "; $buf .= "
---|