summaryrefslogtreecommitdiff
path: root/sitemap.buetow.org/content/sitemap.inc.pl
diff options
context:
space:
mode:
authorPaul C. Buetow (mars.fritz.box) <paul@buetow.org>2014-04-27 12:34:02 +0200
committerPaul C. Buetow (mars.fritz.box) <paul@buetow.org>2014-04-27 12:34:02 +0200
commit7c110eed4873d7805db304f957278320e5aea0c7 (patch)
tree2f051e98538a3a6d2388a433e2fef0d044059828 /sitemap.buetow.org/content/sitemap.inc.pl
parent5bfc5a3dc49dae9aad6a4bd7422ab11a4d56d56a (diff)
add sitemap.inc.pl
Diffstat (limited to 'sitemap.buetow.org/content/sitemap.inc.pl')
-rw-r--r--sitemap.buetow.org/content/sitemap.inc.pl36
1 files changed, 36 insertions, 0 deletions
diff --git a/sitemap.buetow.org/content/sitemap.inc.pl b/sitemap.buetow.org/content/sitemap.inc.pl
new file mode 100644
index 0000000..37740e7
--- /dev/null
+++ b/sitemap.buetow.org/content/sitemap.inc.pl
@@ -0,0 +1,36 @@
+my $hostroot = $config->get_hostroot();
+
+sub getf ($) {
+ open my $f, $_[0] or die "$!: $_[0]\n";
+ my @slurp = <$f>;
+ close $f;
+ @slurp;
+}
+
+sub nl () { "<br />\n" }
+
+sub list (*) {
+ my $tag = shift;
+ my @found = sort `find $hostroot -name $tag`;
+ my $ret = '';
+
+
+ for my $found (@found) {
+ $found =~ /.*hosts.(.*?).$tag/;
+ my $host = $1;
+
+ my @content = getf $found;
+
+ $ret .= "<b><a href=http://$host>$host</a></b>" . nl;;
+
+ if (@content) {
+ $ret .= join " ", @content;
+ $ret .= nl;
+ }
+ $ret .= nl;
+ }
+
+ $ret;
+}
+
+list SITEMAP;