mason/common/autohandler: Add an AGPL link to the HTML header.
[odin-cgi] / bin / shorturl.userv
index edad9f6..a15a527 100755 (executable)
@@ -1,10 +1,32 @@
 #! /usr/bin/perl
+###
+### URL shortening userv interface for Odin
+###
+### (c) 2015 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the `odin.gg' service, `odin-cgi'.
+###
+### `odin-cgi' is free software; you can redistribute it and/or modify
+### it under the terms of the GNU Affero General Public License as
+### published by the Free Software Foundation; either version 3 of the
+### License, or (at your option) any later version.
+###
+### `odin-cgi' is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### GNU Affero General Public License for more details.
+###
+### You should have received a copy of the GNU Affero General Public
+### License along with `odin-cgi'; if not, see
+### <http://www.gnu.org/licenses/>.
 
 use lib "lib";
 
 use Odin;
 use DBI;
-use POSIX;
 
 Odin::cmdline_who;
 
@@ -27,8 +49,7 @@ EOF
        FROM odin_shorturl WHERE owner = ?
        ORDER BY stamp", undef, $Odin::WHO)}) {
     my ($tag, $stamp, $url) = @$r;
-    my $t = strftime "%Y-%m-%d %H:%M:%S %z", localtime $stamp;
-    printf "%-25s  %-12s  %s\n", $t, $tag, $url;
+    Odin::print_columns Odin::fmt_time $stamp => 25, $tag => 12, $url =>0;
   }
 } elsif ($op eq "new") {
   @ARGV == 1 or Odin::fail "usage: new URL";