From 0c3ffa16972ab9be8e1323236ee2e3122b7385c6 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 23 Nov 2024 19:34:16 -0300 Subject: Feat: OPML including all other OPML files --- README.md | 5 +++++ all.opml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ compile | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 all.opml create mode 100755 compile diff --git a/README.md b/README.md index 532c699..cef933f 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,11 @@ the canonical URL: Copy `sample.opml` to a new file and edit to include your own set of feeds! +## Development + +Use the [compile](compile) script to build an OPML including all other +OPML files. + ## References * For the OPML spec, check http://dev.opml.org diff --git a/all.opml b/all.opml new file mode 100644 index 0000000..9c8b949 --- /dev/null +++ b/all.opml @@ -0,0 +1,56 @@ + + + + All Feeds + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/compile b/compile new file mode 100755 index 0000000..899a761 --- /dev/null +++ b/compile @@ -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 + + + + All Feeds + + +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 " " >> $OUT + echo " " >> $OUT +done + +# Footer +cat <<-EOF >> $OUT + + + +EOF -- cgit v1.2.3