summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-04-21 21:24:01 +1200
committerLars Wirzenius <liw@liw.fi>2010-04-21 21:24:01 +1200
commitd45a4d9ef877f4b276235c3b92f741399ba55fd3 (patch)
treecae6081dcbbddf6c7f90d4700505864137fe231d
parent320326a8e890f74cc73f24f824733a97821b04df (diff)
downloadliw-automation-d45a4d9ef877f4b276235c3b92f741399ba55fd3.tar.gz
Add missing-journal-person-create and missing-journal-tag-create.
-rw-r--r--debian/changelog6
-rw-r--r--debian/liw-automation.install12
-rwxr-xr-xmissing-journal-person-create28
-rwxr-xr-xmissing-journal-tag-create20
4 files changed, 61 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index bc5dacb..3f8b0db 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+liw-automation (5) squeeze; urgency=low
+
+ * Add missing-journal-person-create and missing-journal-tag-create.
+
+ -- Lars Wirzenius <liw@liw.fi> Wed, 21 Apr 2010 21:23:45 +1200
+
liw-automation (4) squeeze; urgency=low
* Add world-dates.
diff --git a/debian/liw-automation.install b/debian/liw-automation.install
index 8537c89..3a0ed0e 100644
--- a/debian/liw-automation.install
+++ b/debian/liw-automation.install
@@ -1,5 +1,7 @@
-sync-to-pieni usr/bin
-g usr/bin
-build-journal usr/bin
-journal-note usr/bin
-world-dates usr/bin
+sync-to-pieni usr/bin
+g usr/bin
+build-journal usr/bin
+journal-note usr/bin
+world-dates usr/bin
+missing-journal-person-create usr/bin
+missing-journal-tag-create usr/bin
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);
+ }
+ }
+}
+
diff --git a/missing-journal-tag-create b/missing-journal-tag-create
new file mode 100755
index 0000000..7e7d3d1
--- /dev/null
+++ b/missing-journal-tag-create
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+open(INPUT, "<", "/srv/http/journal/index.html");
+while (<INPUT>) {
+ if (/^<li><span class="createlink">.*page=%2Ftag%2F([^&]*)&amp;from=notes%2F.*\n$/) {
+ s//$1/;
+ my $tag = $_;
+ my $pathname = "/home/liw/Journal/src/tag/$tag.mdwn";
+ if (!-e $pathname) {
+ print "$tag\n";
+ open(OUTPUT, ">", $pathname);
+ print OUTPUT "[[!inline archive=yes pages=\"link(tag/$tag)\"]]\n";
+ close(OUTPUT);
+ }
+ }
+}
+