#!/bin/awk -f
# convert weeds files to an html page
BEGIN {
FS = "\t"
print ""
print ""
print "
Weed Garden"
print ""
print ""
print ""
print ""
print ""
print ""
print ""
}
{
if (++line > 50) {
# Only show the newest 50 things.
exit
}
timestamp = $1
title = $2
link = $3
content = $4
content_type = $5
id = $6
author = $7
enclosure = $8
category = $9
datecmd = "date -u -d \"@" timestamp "\" '+%F (%a) %R'"
datecmd | getline published
close(datecmd)
gsub(/\\t/, "\t", content)
if (title ~ /\[acdw\]/) {
sub(/^/, "", content)
gsub(/\\n\\n/, "\\n
", content)
gsub(/\\n/, "\n", content)
} else {
gsub(/\\n/, "\n", content)
}
gsub(/\\/, "\\", content)
print ""
print "" title "
"
print ""
print content
print ""
}
END {
print ""
print ""
}