--- logger.orig 2008-08-15 03:11:02.000000000 +0100 +++ logger 2009-03-06 11:36:17.000000000 +0000 @@ -8,6 +8,9 @@ # with modifications from Ralph Swick # http://www.w3.org/People/all#swick # +# and more by Toby Inkster +# http://tobyinkster.co.uk/ +# # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 @@ -65,10 +68,10 @@ # MSWin does not permit ":" in file path components $::PortSep = $^O eq "MSWin32" ? "/" : ":"; -$::html_suffix="\n\n\n"; +$::html_suffix="\n\n\n"; $::html_suffix_length=undef; # account for \n to \r\n expansion in stdio -$::rdf_suffix=" \n \n\n\n"; +$::rdf_suffix="\n\n"; $::rdf_suffix_length=undef; # account for \n to \r\n expansion in stdio #URIschemes and URIpatterns must match in order. The order is not signficant. @@ -478,28 +481,31 @@ } my $escaped_chan = xml_escape($channel_name); + my $escaped_chan_uri = xml_escape($self->{URI}); + print $html_log_fh <<"EOT"; - - - - IRC log of $escaped_chan on $date -EOT - my $progID = '$Id$'; - $progID =~ s/\$/\$/g; # Hide the CVS tag from CVS in the output - print $html_log_fh ''; - print $html_log_fh <<"EOT"; - - - + + + + IRC log of $escaped_chan on $date + + + + + - -

IRC log of $escaped_chan on $date

+ +

IRC log of $escaped_chan on $date

Timestamps are in UTC.

-
+ EOT print $html_log_fh $::html_suffix; } else { @@ -537,15 +543,17 @@ } my $escaped_chan_uri = xml_escape($self->{URI}); + my $escaped_chan = xml_escape($channel_name); + print $rdf_log_fh <<"EOT"; - - - + xmlns:dc="http://purl.org/dc/terms/" + xmlns:s="http://rdfs.org/sioc/ns#" + xmlns:st="http://rdfs.org/sioc/types#" + xmlns:f="http://xmlns.com/foaf/0.1/"> + + $escaped_chan EOT print $rdf_log_fh $::rdf_suffix; } else { @@ -595,6 +603,7 @@ my $date = sprintf("%04d-%02d-%02d", $tm[5], $tm[4], $tm[3]); my $time = sprintf("%02d:%02d:%02d", $tm[2], $tm[1], $tm[0]); my $date_time="$date $time"; + my $datetime=$date.'T'.$time.'Z'; my $hour=$tm[2]; # if we're using dated logs and we passed midnight, start new logs @@ -649,7 +658,7 @@ $escapedMsg = URI2link($escapedMsg, @uris); } - print $html_log_fh qq{
$time [$nick]
}.$escapedMsg.qq{
\n}; + print $html_log_fh qq{
\n}; print $html_log_fh $::html_suffix; } @@ -661,18 +670,19 @@ seek($rdf_log_fh, -$::rdf_suffix_length, 2); # 2= SEEK_END print $rdf_log_fh <<"EOT"; - - - ${date}T${time}Z + + + + $datetime EOT - print $rdf_log_fh qq{ }.cvs_escape($msg).qq{\n}; - print $rdf_log_fh qq{ \n} if $nick; + print $rdf_log_fh qq{ }.cvs_escape($msg).qq{\n}; + print $rdf_log_fh qq{ \n} if $nick; foreach my $uri (@uris) { $uri = xml_escape($uri); - print $rdf_log_fh qq{ \n}; + print $rdf_log_fh qq{ \n}; } - print $rdf_log_fh qq{ \n}; - print $rdf_log_fh qq{ \n}; + print $rdf_log_fh qq{ \n}; + print $rdf_log_fh qq{ \n}; print $rdf_log_fh $::rdf_suffix; } @@ -1019,7 +1029,7 @@ } if($command=~ /^(?:pointer|bookmark|here|where am i\?)/i) { - my($log_uri)=$channel->{LogURIPrefix}; + my($log_uri)=$channel->{LogURIPrefix} . '.html'; my $output; if($log_uri) { @@ -1033,6 +1043,19 @@ return; } + if($command=~ /^(?:tell|alert|show|remind)\s+(\S*)$/i) { + my($log_uri)=$channel->{LogURIPrefix}; + my $nick = $1; + my $output; + if($log_uri) { + $log_uri.="#".$channel->{Last_ID} if $channel->{Last_ID}; + my $output ="phenny, tell $nick that $from_nick says see $log_uri"; + $self->privmsg($dest_nick, $output); + log_event($self, $event, time, "pfennig, $output") unless $is_private; + } + return; + } + if($command=~ /^chump\s*(.+)$/i) { my $item=$1; my($log_uri)=$channel->{LogURIPrefix}; @@ -1074,7 +1097,8 @@ " silence - Stop logging (also: stop, off, ...)", " listen - Start logging (also: start, on, ...)", " bookmark - Give the URI of the current log", - " chump LETTER - Record the URI of the current log under chump LETTER", + " tell XX - Give the URI of the current log to nick XX", + " chump LETTER - Record the URI of the current log under chump LETTER", "I respond to '$::Nick, command' in public and '/msg $::Nick command' in private", "Logging Policy: All public output is logged if I am listening except for" ); @@ -1119,7 +1143,12 @@ if ($command =~ /^(?:grep|search for|find)\s+(.+)$/) { $output.=qq{Sorry, searching removed.}; - } else { + } + + if ($from_nick eq 'phenny') { + return; + } + else { $output.="I don't understand '$command', $from_nick. Try /msg $::Nick help"; } @@ -1227,7 +1256,7 @@ foreach my $u (@uri) { my $p = quotemeta $u; - $l =~ s/($p)/$1<\/a>/; + $l =~ s/($p)/$1<\/a>/; } return $l;
$time [$nick]$escapedMsg