summaryrefslogtreecommitdiff
path: root/missing-journal-person-create
diff options
context:
space:
mode:
Diffstat (limited to 'missing-journal-person-create')
-rwxr-xr-xmissing-journal-person-create28
1 files changed, 28 insertions, 0 deletions
diff --git a/missing-journal-person-create b/missing-journal-person-create
new file mode 100755
index 0000000..9468cfa
--- /dev/null
+++ b/missing-journal-person-create
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+open(INPUT, "<", "/srv/http/journal/index.html");
+while (<INPUT>) {
+ if (/^<li><span class="createlink">.*page=people%2F([^&]*).*\n$/) {
+ s//$1/;
+ my $basename = $_;
+ my @names = split /\./, $_;
+ my @Names = map ucfirst, @names;
+ my $family = shift @Names;
+ my $given = join ' ', @Names;
+ my $realname = "$family, $given";
+ my $pathname = "/home/liw/Journal/src/people/$basename.mdwn";
+ if (!-e $pathname) {
+ print "$realname\n";
+ open(OUTPUT, ">", $pathname);
+ print OUTPUT "[[!meta title=\"$realname\"]]\n\n";
+ print OUTPUT "[[!inline feeds=no ";
+ print OUTPUT "pages=\"notes/* and !notes/*/* and ";
+ print OUTPUT "link(people/$basename)\"]]\n";
+ close(OUTPUT);
+ }
+ }
+}
+