]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
[urlgrab] improve url log file format
authorThorsten Scherf <redacted>
Sun, 21 Feb 2021 16:38:59 +0000 (17:38 +0100)
committerThorsten Scherf <redacted>
Mon, 22 Feb 2021 17:10:06 +0000 (18:10 +0100)
scripts/urlgrab.pl

index adbb770e10d787830c2c9d0ae43db35dcfe3a9ea..5f83a305be138369a85dc9eef328ab5b8a6ed020 100644 (file)
@@ -7,12 +7,13 @@
 #
 
 use strict;
+use Time::Piece;
 use Irssi 20010120.0250 ();
 use vars qw($VERSION %IRSSI);
-$VERSION = "0.4";
+$VERSION = "0.5";
 %IRSSI = (
-    authors     => 'David Leadbeater',
-    contact     => 'dgl@dgl.cx',
+    authors     => 'David Leadbeater, Thorsten Scherf',
+    contact     => 'dgl@dgl.cx, tscherf@redhat.com',
     name        => 'urlgrab',
     description => 'Captures urls said in channel and private messages and saves them to a file, also adds a /url command which loads the last said url into a browser.',
     license     => 'GNU GPLv2 or later',
@@ -55,11 +56,12 @@ sub find_url {
 }
 
 sub url_log{
+   my $t = localtime;
    my($where,$channel,$url) = @_;
    return if lc $url eq lc $lasturl; # a tiny bit of protection from spam/flood
    $lasturl = $url;
    open(URLLOG, ">>", $file) or return;
-   print URLLOG time." $where $channel $lasturl\n";
+   print URLLOG $t->datetime . " $where $channel $lasturl\n";
    close(URLLOG);
 }
 
git clone https://git.99rst.org/PROJECT