diff --git a/lib/utils/print.pm b/lib/utils/print.pm index ed0b51890a3d72d1c61fe70f3785ce3aa6a15773..2b17bf7e49b6dd0bb4ade429d89fdf7a2a463c63 100644 --- a/lib/utils/print.pm +++ b/lib/utils/print.pm @@ -2,6 +2,8 @@ package utils::print; use strict; +use IRC::Utils qw(YELLOW ORANGE GREEN NORMAL LIGHT_BLUE GREY); + # Used to print a content. # The public subroutine is print($content). # arg : @@ -18,7 +20,7 @@ use strict; sub print { my ($content) = @_; - my $msg = '['.$content->{'id'}.'] '.$content->{'title'}; + my $msg = YELLOW.'['.$content->{'id'}.'] '.GREEN.$content->{'title'}; if (defined $content->{'author'}) { $msg .= ' | '.$content->{'author'}; @@ -29,19 +31,21 @@ sub print { my $m = int(($content->{'duration'} % 3600) / 60); my $s = int(($content->{'duration'} % 3600) % 60); - $msg .= ' ('; + $msg .= LIGHT_BLUE.' ('; $msg .= sprintf("%02d:", $h) if ($h > 0); $msg .= sprintf("%02d:", $m); $msg .= sprintf("%02d", $s); - $msg .= ')'; + $msg .= ')'.NORMAL; } - $msg .= ' => '.$content->{'url'} if (defined $content->{'url'}); + $msg .= ' => '.$content->{'url'}.ORANGE if (defined $content->{'url'}); if (defined $content->{'tags'}) { $msg .= ' '.$_ foreach (@{$content->{'tags'}}); } + $msg .= GREY; + return $msg; }