summaryrefslogtreecommitdiff
path: root/scripts/missing-journal-tag-create
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/missing-journal-tag-create')
-rwxr-xr-xscripts/missing-journal-tag-create20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/missing-journal-tag-create b/scripts/missing-journal-tag-create
new file mode 100755
index 0000000..7e7d3d1
--- /dev/null
+++ b/scripts/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);
+ }
+ }
+}
+