From 324fb24b45d47788bf6073e07cc1386d2148ab28 Mon Sep 17 00:00:00 2001 From: DanielMowitz Date: Sat, 16 Oct 2021 13:52:25 +0200 Subject: [PATCH] Began adding functionality to mark new feed entries. --- autom4te.cache/requests | 304 +++++++++++++++++++------------------- src/Makefile.am | 2 +- src/Makefile.in | 2 +- src/mark-new-feed-entries | 29 ++++ src/update-xslfeed | 6 + 5 files changed, 189 insertions(+), 154 deletions(-) create mode 100644 src/mark-new-feed-entries diff --git a/autom4te.cache/requests b/autom4te.cache/requests index 42eb5dc..99a1bf2 100644 --- a/autom4te.cache/requests +++ b/autom4te.cache/requests @@ -33,47 +33,47 @@ 'configure.ac' ], { - '_AM_AUTOCONF_VERSION' => 1, - '_AM_SET_OPTION' => 1, - 'AM_PROG_INSTALL_SH' => 1, - 'AM_DEP_TRACK' => 1, - '_AM_SET_OPTIONS' => 1, - 'AM_SUBST_NOTMAKE' => 1, - '_AM_DEPENDENCIES' => 1, - 'AM_PROG_INSTALL_STRIP' => 1, - 'AM_SILENT_RULES' => 1, - 'AM_MISSING_HAS_RUN' => 1, - '_m4_warn' => 1, 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - '_AC_AM_CONFIG_HEADER_HOOK' => 1, - 'AC_DEFUN_ONCE' => 1, - 'AM_AUX_DIR_EXPAND' => 1, - '_AM_PROG_TAR' => 1, - 'AM_MISSING_PROG' => 1, - 'AC_DEFUN' => 1, - 'AM_PROG_CC_C_O' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'm4_pattern_forbid' => 1, - '_AM_CONFIG_MACRO_DIRS' => 1, - 'AM_CONDITIONAL' => 1, 'AM_SANITY_CHECK' => 1, - 'include' => 1, - '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'm4_pattern_allow' => 1, - '_AM_PROG_CC_C_O' => 1, - 'm4_include' => 1, - 'AM_SET_LEADING_DOT' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AC_CONFIG_MACRO_DIR' => 1, - 'AM_RUN_LOG' => 1, - 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, - 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - '_AM_MANGLE_OPTION' => 1, - 'AM_SET_DEPDIR' => 1, - 'AU_DEFUN' => 1, - 'AM_MAKE_INCLUDE' => 1, + 'AM_AUTOMAKE_VERSION' => 1, '_AM_IF_OPTION' => 1, - '_AM_SUBST_NOTMAKE' => 1 + '_AM_PROG_TAR' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'm4_include' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_DEFUN_ONCE' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + 'AM_MISSING_HAS_RUN' => 1, + 'm4_pattern_allow' => 1, + 'm4_pattern_forbid' => 1, + '_AM_DEPENDENCIES' => 1, + '_AM_SET_OPTIONS' => 1, + 'AC_DEFUN' => 1, + '_m4_warn' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'include' => 1, + 'AM_SILENT_RULES' => 1, + '_AM_PROG_CC_C_O' => 1, + '_AM_MANGLE_OPTION' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'AM_RUN_LOG' => 1, + 'AM_MAKE_INCLUDE' => 1, + '_AM_SET_OPTION' => 1, + 'AM_DEP_TRACK' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_SET_LEADING_DOT' => 1, + 'AM_PROG_CC_C_O' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, + 'AM_SET_DEPDIR' => 1, + 'AM_PROG_INSTALL_STRIP' => 1, + 'AU_DEFUN' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_MISSING_PROG' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + 'AM_CONDITIONAL' => 1 } ], 'Autom4te::Request' ), bless( [ @@ -88,69 +88,69 @@ 'configure.ac' ], { - '_AM_MAKEFILE_INCLUDE' => 1, - 'LT_INIT' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AM_PATH_GUILE' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AM_PROG_MKDIR_P' => 1, - 'IT_PROG_INTLTOOL' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AC_FC_FREEFORM' => 1, - 'AC_INIT' => 1, - 'AM_EXTRA_RECURSIVE_TARGETS' => 1, - 'AM_XGETTEXT_OPTION' => 1, - 'AM_MAINTAINER_MODE' => 1, - 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - 'AC_CANONICAL_BUILD' => 1, - 'AC_CANONICAL_TARGET' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - 'include' => 1, - 'm4_pattern_allow' => 1, - 'AM_PROG_AR' => 1, 'AC_CONFIG_SUBDIRS' => 1, - 'AM_PROG_MOC' => 1, - '_m4_warn' => 1, - 'GTK_DOC_CHECK' => 1, - 'AC_CONFIG_LINKS' => 1, - 'AM_PROG_CXX_C_O' => 1, 'AM_POT_TOOLS' => 1, - 'AM_PROG_CC_C_O' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'AC_PROG_LIBTOOL' => 1, - 'AC_SUBST' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, '_LT_AC_TAGCONFIG' => 1, - 'AC_FC_PP_SRCEXT' => 1, - '_AM_COND_ELSE' => 1, - 'AM_SILENT_RULES' => 1, - 'AC_REQUIRE_AUX_FILE' => 1, - 'AM_ENABLE_MULTILIB' => 1, 'AC_LIBSOURCE' => 1, '_AM_SUBST_NOTMAKE' => 1, - 'AM_PROG_LIBTOOL' => 1, - 'AM_CONDITIONAL' => 1, - 'AC_FC_SRCEXT' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'AH_OUTPUT' => 1, - 'm4_include' => 1, - 'AC_FC_PP_DEFINE' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - 'AC_SUBST_TRACE' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AM_PROG_F77_C_O' => 1, - 'AC_CONFIG_FILES' => 1, - 'AM_PROG_FC_C_O' => 1, - 'm4_pattern_forbid' => 1, - '_AM_COND_ENDIF' => 1, - 'sinclude' => 1, - '_AM_COND_IF' => 1, - 'AM_NLS' => 1, 'AM_GNU_GETTEXT' => 1, - 'm4_sinclude' => 1 + 'AC_FC_PP_SRCEXT' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AM_PROG_MOC' => 1, + 'AH_OUTPUT' => 1, + 'AM_PATH_GUILE' => 1, + 'AC_FC_FREEFORM' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'GTK_DOC_CHECK' => 1, + 'AC_SUBST' => 1, + 'LT_INIT' => 1, + '_AM_COND_ELSE' => 1, + 'AC_FC_SRCEXT' => 1, + 'm4_sinclude' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_PROG_AR' => 1, + '_AM_COND_ENDIF' => 1, + 'AC_SUBST_TRACE' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AC_CONFIG_HEADERS' => 1, + '_m4_warn' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + '_AM_COND_IF' => 1, + 'IT_PROG_INTLTOOL' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_NLS' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_INIT' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AC_CONFIG_FILES' => 1, + 'sinclude' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'include' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'm4_include' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'm4_pattern_forbid' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'm4_pattern_allow' => 1, + 'AC_REQUIRE_AUX_FILE' => 1 } ], 'Autom4te::Request' ), bless( [ @@ -166,69 +166,69 @@ 'configure.ac' ], { - 'AM_GNU_GETTEXT' => 1, - 'AM_NLS' => 1, - 'm4_sinclude' => 1, - '_AM_COND_IF' => 1, - '_AM_COND_ENDIF' => 1, - 'sinclude' => 1, - 'AM_PROG_F77_C_O' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'm4_pattern_forbid' => 1, - 'AC_CONFIG_FILES' => 1, - 'AM_PROG_FC_C_O' => 1, - 'AC_SUBST_TRACE' => 1, - 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AC_FC_PP_DEFINE' => 1, - 'AH_OUTPUT' => 1, - 'm4_include' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'AC_FC_SRCEXT' => 1, 'AM_CONDITIONAL' => 1, - 'AM_PROG_LIBTOOL' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AC_LIBSOURCE' => 1, - 'AM_ENABLE_MULTILIB' => 1, - 'AM_SILENT_RULES' => 1, - 'AC_REQUIRE_AUX_FILE' => 1, - 'AC_FC_PP_SRCEXT' => 1, - '_AM_COND_ELSE' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - 'AC_SUBST' => 1, - 'AC_PROG_LIBTOOL' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AM_PROG_CC_C_O' => 1, - 'AM_POT_TOOLS' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'AM_PROG_CXX_C_O' => 1, - 'AM_PROG_MOC' => 1, - '_m4_warn' => 1, - 'AC_CONFIG_LINKS' => 1, - 'GTK_DOC_CHECK' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - 'AM_PROG_AR' => 1, - 'include' => 1, - 'm4_pattern_allow' => 1, - 'AC_CANONICAL_SYSTEM' => 1, + 'AC_CANONICAL_HOST' => 1, 'AC_CANONICAL_TARGET' => 1, - 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - 'AM_MAINTAINER_MODE' => 1, - 'AM_XGETTEXT_OPTION' => 1, - 'AM_EXTRA_RECURSIVE_TARGETS' => 1, - 'AC_CANONICAL_BUILD' => 1, - 'IT_PROG_INTLTOOL' => 1, - 'AM_PROG_MKDIR_P' => 1, - 'AC_INIT' => 1, - 'AC_FC_FREEFORM' => 1, 'AC_CONFIG_AUX_DIR' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_NLS' => 1, + 'IT_PROG_INTLTOOL' => 1, + '_AM_COND_IF' => 1, + 'sinclude' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_PROG_LIBTOOL' => 1, + 'AM_PROG_CC_C_O' => 1, + 'AC_CANONICAL_BUILD' => 1, + 'AC_INIT' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'include' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'm4_pattern_allow' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'm4_pattern_forbid' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'm4_include' => 1, 'AM_INIT_AUTOMAKE' => 1, - 'AM_PATH_GUILE' => 1, + 'AM_MAINTAINER_MODE' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'AH_OUTPUT' => 1, + 'AM_PROG_MOC' => 1, + 'AM_PROG_FC_C_O' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AM_GNU_GETTEXT' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_POT_TOOLS' => 1, + 'AC_LIBSOURCE' => 1, + 'AC_FC_SRCEXT' => 1, + '_AM_COND_ELSE' => 1, + 'AC_SUBST' => 1, 'LT_INIT' => 1, + 'GTK_DOC_CHECK' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AC_FC_FREEFORM' => 1, + 'AM_PATH_GUILE' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'AC_SUBST_TRACE' => 1, + '_AM_COND_ENDIF' => 1, + 'AM_PROG_AR' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + 'AM_SILENT_RULES' => 1, + 'm4_sinclude' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, '_AM_MAKEFILE_INCLUDE' => 1, - 'AC_CANONICAL_HOST' => 1 + 'AC_CONFIG_LIBOBJ_DIR' => 1 } ], 'Autom4te::Request' ) ); diff --git a/src/Makefile.am b/src/Makefile.am index 5e16e43..1bc6dd8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ xslfeedconfdir = $(sysconfdir)/xslfeed -dist_bin_SCRIPTS = combine-md-files generate-website-from-md get-feeds update-xslfeed +dist_bin_SCRIPTS = combine-md-files generate-website-from-md get-feeds update-xslfeed mark-new-feed-entries dist_xslfeedconf_DATA = opml2list.xml rss2md.xml style.css diff --git a/src/Makefile.in b/src/Makefile.in index 1487612..5f9acf0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -227,7 +227,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ xslfeedconfdir = $(sysconfdir)/xslfeed -dist_bin_SCRIPTS = combine-md-files generate-website-from-md get-feeds update-xslfeed +dist_bin_SCRIPTS = combine-md-files generate-website-from-md get-feeds update-xslfeed mark-new-feed-entries dist_xslfeedconf_DATA = opml2list.xml rss2md.xml style.css all: all-am diff --git a/src/mark-new-feed-entries b/src/mark-new-feed-entries new file mode 100644 index 0000000..157bbd3 --- /dev/null +++ b/src/mark-new-feed-entries @@ -0,0 +1,29 @@ +#!/bin/sh + +file=$1 +curr=`date -d "yesterday 00:00" +%s` +lines=() +news=0 + +while read line +do + stamp=`echo $line | sed -e 's/^ *- *\(.\{25\}\).*$/\1/' -e 's/^#.*/1970-01-01/'` + time=`date -d "$stamp" +%s` + if [ "$time" -gt "$curr" ] + then + news=$(($news + 1)) + lines+=("$(echo $line | sed -e 's/^\( *\)- *\(.*\)$/\1- \*\2\*/')") + else + lines+=("$line") + fi +done < $file + +if [ "$news" -gt "0" ] +then + lines[0]=`echo "$lines[0]" | sed -e "s/^#\(#*\) *\(.*\)$/#\1 \*\2 ($news)\*/"` +fi + +for line in "${lines[@]}" +do + echo $line +done diff --git a/src/update-xslfeed b/src/update-xslfeed index 1a0ec7f..8d46ba4 100644 --- a/src/update-xslfeed +++ b/src/update-xslfeed @@ -2,4 +2,10 @@ get-feeds combine-md-files Feeds $HOME/xslfeed/feeds/* > $HOME/xslfeed/feeds.md + +for file in $HOME/xslfeed/feeds/* +do + mark-new-feed-entries $file > $file +done + generate-website-from-md $HOME/xslfeed/feeds.md /etc/xslfeed/style.css