diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 33 | ||||
-rw-r--r-- | README | 45 |
3 files changed, 56 insertions, 24 deletions
@@ -2,4 +2,4 @@ sfeed sfeed_plain sfeed_html -sfeed_opml_config +sfeed_opml_import @@ -3,10 +3,10 @@ include config.mk NAME = sfeed -SRC = sfeed.c sfeed_plain.c sfeed_html.c sfeed_opml_config.c +SRC = sfeed.c sfeed_plain.c sfeed_html.c sfeed_opml_import.c OBJ = ${SRC:.c=.o} -all: options sfeed sfeed_plain sfeed_html sfeed_opml_config +all: options sfeed sfeed_plain sfeed_html sfeed_opml_import options: @echo ${NAME} build options: @@ -24,9 +24,9 @@ sfeed: ${OBJ} @echo CC -o $@ @${CC} -o $@ sfeed.c ${LDFLAGS} ${LIBEXPAT} -sfeed_opml_config: sfeed_opml_config.o +sfeed_opml_import: sfeed_opml_import.o @echo CC -o $@ - @${CC} -o $@ sfeed_opml_config.o ${LDFLAGS} ${LIBEXPAT} + @${CC} -o $@ sfeed_opml_import.o ${LDFLAGS} ${LIBEXPAT} sfeed_plain: sfeed_plain.o @echo CC -o $@ @@ -38,15 +38,15 @@ sfeed_html: sfeed_html.o clean: @echo cleaning - @rm -f sfeed sfeed_plain sfeed_html sfeed_opml_config ${OBJ} ${NAME}-${VERSION}.tar.gz + @rm -f sfeed sfeed_plain sfeed_html sfeed_opml_import ${OBJ} ${NAME}-${VERSION}.tar.gz dist: clean @echo creating dist tarball @mkdir -p ${NAME}-${VERSION} @cp -R LICENSE Makefile README config.mk \ TODO CREDITS sfeedrc.example ${SRC} common.c sfeed_update \ - sfeed.1 sfeed_update.1 sfeed_plain.1 sfeed_html.1 sfeed_opml_config.1 \ - ${NAME}-${VERSION} + sfeed.1 sfeed_update.1 sfeed_plain.1 sfeed_html.1 sfeed_opml_import.1 \ + sfeed_opml_export.1 ${NAME}-${VERSION} @tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION} @gzip ${NAME}-${VERSION}.tar @rm -rf ${NAME}-${VERSION} @@ -54,13 +54,14 @@ dist: clean install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin - @cp -f sfeed sfeed_html sfeed_plain sfeed_update sfeed_opml_config \ - ${DESTDIR}${PREFIX}/bin + @cp -f sfeed sfeed_html sfeed_plain sfeed_update sfeed_opml_import \ + sfeed_opml_export ${DESTDIR}${PREFIX}/bin @chmod 755 ${DESTDIR}${PREFIX}/bin/sfeed \ ${DESTDIR}${PREFIX}/bin/sfeed_html \ ${DESTDIR}${PREFIX}/bin/sfeed_plain \ ${DESTDIR}${PREFIX}/bin/sfeed_update \ - ${DESTDIR}${PREFIX}/bin/sfeed_opml_config + ${DESTDIR}${PREFIX}/bin/sfeed_opml_import \ + ${DESTDIR}${PREFIX}/bin/sfeed_opml_export @mkdir -p ${DESTDIR}${PREFIX}/share/sfeed @cp -f sfeedrc.example ${DESTDIR}${PREFIX}/share/${NAME} @echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1 @@ -69,12 +70,14 @@ install: all @sed "s/VERSION/${VERSION}/g" < sfeed_update.1 > ${DESTDIR}${MANPREFIX}/man1/sfeed_update.1 @sed "s/VERSION/${VERSION}/g" < sfeed_plain.1 > ${DESTDIR}${MANPREFIX}/man1/sfeed_plain.1 @sed "s/VERSION/${VERSION}/g" < sfeed_html.1 > ${DESTDIR}${MANPREFIX}/man1/sfeed_html.1 - @sed "s/VERSION/${VERSION}/g" < sfeed_opml_config.1 > ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_config.1 + @sed "s/VERSION/${VERSION}/g" < sfeed_opml_import.1 > ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_import.1 + @sed "s/VERSION/${VERSION}/g" < sfeed_opml_export.1 > ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_export.1 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/sfeed.1 \ ${DESTDIR}${MANPREFIX}/man1/sfeed_update.1 \ ${DESTDIR}${MANPREFIX}/man1/sfeed_plain.1 \ ${DESTDIR}${MANPREFIX}/man1/sfeed_html.1 \ - ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_config.1 + ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_import.1 \ + ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_export.1 uninstall: @echo removing executable file from ${DESTDIR}${PREFIX}/bin @@ -82,7 +85,8 @@ uninstall: ${DESTDIR}${PREFIX}/bin/sfeed_html \ ${DESTDIR}${PREFIX}/bin/sfeed_plain \ ${DESTDIR}${PREFIX}/bin/sfeed_update \ - ${DESTDIR}${PREFIX}/bin/sfeed_opml_config \ + ${DESTDIR}${PREFIX}/bin/sfeed_opml_import \ + ${DESTDIR}${PREFIX}/bin/sfeed_opml_export \ ${DESTDIR}${PREFIX}/share/${NAME}/sfeedrc.example @-rmdir ${DESTDIR}${PREFIX}/share/${NAME} @echo removing manual pages from ${DESTDIR}${MANPREFIX}/man1 @@ -90,6 +94,7 @@ uninstall: ${DESTDIR}${MANPREFIX}/man1/sfeed_update.1 \ ${DESTDIR}${MANPREFIX}/man1/sfeed_plain.1 \ ${DESTDIR}${MANPREFIX}/man1/sfeed_html.1 \ - ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_config.1 + ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_import.1 \ + ${DESTDIR}${MANPREFIX}/man1/sfeed_opml_export.1 .PHONY: all options clean dist install uninstall @@ -8,14 +8,14 @@ Dependencies ------------ - C compiler. -- expat library (used by sfeed.c and sfeed_opml_config.c, +- expat library (used by sfeed.c and sfeed_opml_import.c, http://expat.sourceforge.net/). Optional dependencies --------------------- -- POSIX shell (used by sfeed_update). +- POSIX shell (used by sfeed_update and sfeed_opml_export). - curl (used by sfeed_update, http://curl.haxx.se/). - iconv (used by sfeed_update, http://www.gnu.org/software/libiconv/). @@ -29,7 +29,8 @@ sfeed_update - Shellscript; update feeds and merge with old feeds in the file $HOME/.sfeed/feeds by default. sfeed_plain - Format feeds file (TSV) from sfeed_update to plain text. sfeed_html - Format feeds file (TSV) from sfeed_update to HTMLi. -sfeed_opml_config - Generate a sfeedrc config file based on an opml file. +sfeed_opml_import - Generate a sfeedrc config file based on an opml file. +sfeed_opml_export - Generate an opml file based on a sfeedrc config file. sfeedrc.example - Example config file. @@ -77,6 +78,7 @@ item author - string feed type - string ("rss" or "atom") feed name - string (extra field added by sfeed_update) feed url - string (extra field added by sfeed_update) +item baseurl site - string (extra field added by sfeed_update) Usage @@ -87,12 +89,6 @@ To build and install (respects DESTDIR and PREFIX variable): make install -Generate a sfeedrc config file from your exported list of feeds in opml -format: - -sfeed_opml_config < opmlfile.xml > $HOME/.sfeed/sfeedrc - - To update feeds and format the feeds file (configfile argument is optional): sfeed_update "configfile" @@ -117,6 +113,18 @@ or to view in your editor: $EDITOR "$HOME/.sfeed/feeds.txt" +Generate a sfeedrc config file from your exported list of feeds in opml +format: + +sfeed_opml_import < opmlfile.xml > $HOME/.sfeed/sfeedrc + + +Export an opml file of your feeds from a sfeedrc config file (configfile +arguments is optional): + +sfeed_opml_export configfile > myfeeds.opml + + tip to remove feeds older than a date (change time="YYYY mm dd HH mm ss") gawk -F '\t' 'BEGIN { @@ -131,6 +139,25 @@ gawk -F '\t' 'BEGIN { mv feeds.clean feeds +Common errors and solutions +--------------------------- + +If you execute sfeed_update and see the error: + + "sfeed: error parsing xml not well-formed (invalid token) at line <linenumber> + column <column>" + +it's possible sfeed is trying to parse a feed which is non-UTF8 encoded. You can +specify the encoding in your sfeedrc file so it will be converted to UTF-8 +using iconv, for example for iso-8859-1 change: + + feed "feedname" "feedurl" "baseurl" + +to: + + feed "feedname" "feedurl" "baseurl" "iso-8859-1" + + License ------- |