#!/usr/bin/perl use strict; use warnings; open(INPUT, "<", "/home/liw/Journal/html/index.html"); while () { if (/^
  • .*page=%2Ftag%2F([^&]*)&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); } } }