diff options
author | Case Duckworth | 2022-08-09 21:58:21 -0500 |
---|---|---|
committer | Case Duckworth | 2022-08-09 21:58:21 -0500 |
commit | 820f32f345167362526f9c36c262eea7eb4e9e96 (patch) | |
tree | 4caa589ad86aab5886e66ab6d463a7f7b774d903 /sfeed_update_urls.sh | |
parent | Remove comments from HTML output (diff) | |
download | sfeed-820f32f345167362526f9c36c262eea7eb4e9e96.tar.gz sfeed-820f32f345167362526f9c36c262eea7eb4e9e96.zip |
Add extra fun stuff to feeds
Yet to be implemented
Diffstat (limited to 'sfeed_update_urls.sh')
-rwxr-xr-x | sfeed_update_urls.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sfeed_update_urls.sh b/sfeed_update_urls.sh index d4eaebf..9251813 100755 --- a/sfeed_update_urls.sh +++ b/sfeed_update_urls.sh | |||
@@ -3,7 +3,14 @@ | |||
3 | . "$1" | 3 | . "$1" |
4 | 4 | ||
5 | feed() { # feed NAME URL BASE_URL ENCODING | 5 | feed() { # feed NAME URL BASE_URL ENCODING |
6 | printf '%s\t%s\t%s\n' "$1" "$2" "${3:-}" | 6 | name="$1" |
7 | url="$2" | ||
8 | base="$3" | ||
9 | encoding="$4" | ||
10 | shift 4 | ||
11 | printf '%s\t%s\t%s' "$name" "$url" "${base:-}" | ||
12 | printf '\t%s' "$@" | ||
13 | printf '\n' | ||
7 | } | 14 | } |
8 | 15 | ||
9 | DIR="${SFEED_DATA:-$HOME/.sfeed}/urls" | 16 | DIR="${SFEED_DATA:-$HOME/.sfeed}/urls" |
@@ -16,4 +23,8 @@ BEGIN{FS="\t";} | |||
16 | file = dir "/" $1; | 23 | file = dir "/" $1; |
17 | if ($2) print $2 > file; | 24 | if ($2) print $2 > file; |
18 | if ($3) print $3 >> file; | 25 | if ($3) print $3 >> file; |
26 | for (i=4;i<=NF;i++) { | ||
27 | print $i >> file; | ||
28 | } | ||
29 | close(file); | ||
19 | }' | 30 | }' |