commit 3b920ff9620dd59a5c1ae90a4edf307e3d24b6b4 parent d3b8c61ad3a8c06f531ccb0fa085d799470d21ed Author: Cem Keylan <cem@ckyln.com> Date: Thu, 28 Nov 2019 10:10:18 +0300 add sfeed function Diffstat:
A | func/sb_sfeed_new | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/func/sb_sfeed_new b/func/sb_sfeed_new @@ -0,0 +1,13 @@ +# Get number of feeds that are recently published +# Gets location as first argument +# Defaults to ~/.sfeed/feeds +# Gets name as second argument +# Defaults to "Feed" + +sfeed_new() { + LOCATION="$1" && [ -z "$LOCATION" ] && LOCATION="$HOME/.sfeed/feeds" + NAME="$2" && [ -z "$NAME" ] && NAME="Feed" + printf "$NAME: " + sfeed_plain "$LOCATION"/* | grep '^N' | wc -l | tr '\n' ' ' || return 1 + printf "$DELIMETER " +}