diff options
author | Case Duckworth | 2022-07-19 13:07:46 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-19 13:07:46 -0500 |
commit | db65a9ac6095c0536d796e53e15abe45649a92ec (patch) | |
tree | 4d336df398907e35789df2f8680a0ed4242274d7 | |
parent | Add runcmd (diff) | |
download | sfeed-db65a9ac6095c0536d796e53e15abe45649a92ec.tar.gz sfeed-db65a9ac6095c0536d796e53e15abe45649a92ec.zip |
Add unsubscribe functionality
-rwxr-xr-x | runsfeed | 5 | ||||
-rwxr-xr-x | sfeed_unubscribe.sh | 12 | ||||
-rw-r--r-- | sfeedrc | 6 |
3 files changed, 22 insertions, 1 deletions
diff --git a/runsfeed b/runsfeed index 75b141b..3fc6ee6 100755 --- a/runsfeed +++ b/runsfeed | |||
@@ -52,13 +52,16 @@ main() { | |||
52 | log Done. | 52 | log Done. |
53 | } | 53 | } |
54 | 54 | ||
55 | update_urls() { | ||
56 | runcmd() { | 55 | runcmd() { |
57 | cmd="$(command -v "$1" || echo "./$1")" | 56 | cmd="$(command -v "$1" || echo "./$1")" |
58 | shift | 57 | shift |
59 | "$cmd" "$@" | 58 | "$cmd" "$@" |
60 | } | 59 | } |
61 | 60 | ||
61 | remove_unsubs() { | ||
62 | runcmd sfeed_unsubscribe.sh "$@" | ||
63 | } | ||
64 | |||
62 | update_urls() { | 65 | update_urls() { |
63 | runcmd sfeed_update_urls.sh "$@" | 66 | runcmd sfeed_update_urls.sh "$@" |
64 | } | 67 | } |
diff --git a/sfeed_unubscribe.sh b/sfeed_unubscribe.sh new file mode 100755 index 0000000..eec81ce --- /dev/null +++ b/sfeed_unubscribe.sh | |||
@@ -0,0 +1,12 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | rmfeed() { | ||
4 | feed="$(echo "$1" | tr '/' '_')" | ||
5 | rm "${sfeedpath}/${feed}" | ||
6 | } | ||
7 | |||
8 | alias feed=rmfeed | ||
9 | |||
10 | . "$1" | ||
11 | |||
12 | unsubscribe_feeds | ||
diff --git a/sfeedrc b/sfeedrc index 3a47d12..f9312f1 100644 --- a/sfeedrc +++ b/sfeedrc | |||
@@ -164,6 +164,12 @@ feeds_me() { | |||
164 | : | 164 | : |
165 | } | 165 | } |
166 | 166 | ||
167 | ### Remove feeds ################################################ | ||
168 | |||
169 | unsubscribe_feeds() { | ||
170 | : | ||
171 | } | ||
172 | |||
167 | ### Filter ###################################################### | 173 | ### Filter ###################################################### |
168 | 174 | ||
169 | filter() { | 175 | filter() { |