From 5e0af288656f1a0b41ed92124fd760b1ceeea6fd Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 3 Aug 2012 15:00:29 +0200 Subject: Add sfeed_opml_export script Signed-off-by: Hiltjo Posthuma --- sfeed_opml_export | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 sfeed_opml_export (limited to 'sfeed_opml_export') diff --git a/sfeed_opml_export b/sfeed_opml_export new file mode 100755 index 0000000..870ae34 --- /dev/null +++ b/sfeed_opml_export @@ -0,0 +1,52 @@ +#!/bin/sh + +# load config (evaluate shellscript). +# loadconfig(configfile) +loadconfig() { + # allow to specify config via argv[1]. + if [ ! "$1" = "" ]; then + # get absolute path of config file. + config=$(readlink -f "$1") + else + # default config location. + config="$HOME/.sfeed/sfeedrc" + fi + + # load config: config is loaded here to be able to override above variables + # (sfeedpath, sfeedfile, etc). + if [ -r "$config" ]; then + . "$config" + else + echo "Configuration file \"$config\" does not exist or is not readable." >&2 + exit 1 + fi +} + +# override feeds function to ouput opml XML. +# feed(name, feedurl, basesiteurl, [encoding]) +feed() { + cat < +! +} + +# load config file. +loadconfig "$1" + +cat < + + + opml export from sfeed + + +! + +feeds + +cat < + +! -- cgit v1.2.3