[Mailman-Users] sitemap.xml for Mailman

Mark Sapiro mark at msapiro.net
Thu Nov 22 19:36:47 CET 2012

Tomasz Chmielewski wrote:
>I wrote a simple bash script which generates a sitemap.xml file (i.e. to 
>be submitted to Google):

There is an issue with the above script. Namely, the XML generated only
contains data for the last list in $LISTS. This will fix that

--- sitemap.old 2012-11-22 10:02:51.000000000 -0800
+++ sitemap.new 2012-11-22 10:27:37.000000000 -0800
@@ -18,8 +18,10 @@
 set -u

 # find html files with their dates
 for LIST in $LISTS; do
-    URLS=$(find $MAILMANPATH/$LIST/ -type f -name \*html | xargs ls
--time-style=long-iso -l | awk '{print $6"T"$7":00+00:00 "$8}' | grep
-v attachments)
+    URLS="$URLS
+$(find $MAILMANPATH/$LIST/ -type f -name \*html | xargs ls
--time-style=long-iso -l | awk '{print $6"T"$7":00+00:00 "$8}' | grep
-v attachments)"

 # if the article is crawled once a month, it should be enough

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list