diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-11-23 19:34:16 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-11-23 19:34:16 -0300 |
commit | 0c3ffa16972ab9be8e1323236ee2e3122b7385c6 (patch) | |
tree | 1169a6ef93e8264a5e5d808304f2ccf36bcf215c /compile | |
parent | e48cd9cf356a5f1787583de6106b1b880a1b296a (diff) | |
download | feeds-0c3ffa16972ab9be8e1323236ee2e3122b7385c6.tar.gz feeds-0c3ffa16972ab9be8e1323236ee2e3122b7385c6.tar.bz2 |
Feat: OPML including all other OPML files
Diffstat (limited to 'compile')
-rwxr-xr-x | compile | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -0,0 +1,40 @@ +#!/usr/bin/env sh +# +# Compile an OPML including all other OPML files. +# + +# Parameters +BASENAME="`basename $0`" +DIRNAME="`dirname $0`" +OUT="$DIRNAME/all.opml" + +# Header +cat <<-EOF > $OUT +<?xml version="1.0"?> +<opml version="1.0"> + <head> + <title>All Feeds</title> + </head> + <body> +EOF + +# Contend +find $DIRNAME -name '*.opml' | while read item; do + name="`basename $item .opml`" + base="`dirname $item`" + + # Avoid recursion + if [ "$name" = "all" ]; then + continue + fi + + #echo " <outline type=\"include\" xmlUrl=\"${item}\" title=\"${base}/${name}\"/>" >> $OUT + echo " <outline type=\"include\" xmlUrl=\"${item}\"/>" >> $OUT +done + +# Footer +cat <<-EOF >> $OUT + </outline> + </body> +</opml> +EOF |