diff options
| author | Fuwn <[email protected]> | 2023-10-08 20:38:03 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-10-08 20:38:03 -0700 |
| commit | 3b0de76c51e88b7be70c85e1dffc2346aa5e1303 (patch) | |
| tree | db6e4efae9007f1e858fca015105715b931bed27 | |
| parent | docs(readme): add newsboat examples (diff) | |
| download | suzuri-main.tar.xz suzuri-main.zip | |
| -rwxr-xr-x | suzuri | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -49,6 +49,8 @@ fi if [[ -n "${SUZURI_RSS}" ]]; then IFS=$'\n' read -r -d '' -a items <<<"${body}" + start_index_time=$(date -d "today" '+%a, %d %b %Y 00:00:00 %z') + item_index=1 if [[ -n "${folder}" ]]; then folder_title=" | ${folder}" @@ -63,10 +65,13 @@ if [[ -n "${SUZURI_RSS}" ]]; then <generator>suzuri</generator> <language>en-US</language> <lastBuildDate>$(date +'%a, %d %b %Y %H:%M:%S %z')</lastBuildDate> - <pubDate>$(date +'%a, %d %b %Y %H:%M:%S %z')</pubDate> + <pubDate>$(date +'%a, %d %b %y %h:%m:%s %z')</pubDate> EOF for item in "${items[@]}"; do + item_index=$((item_index + 1)) + current_time=$(date -d "${start_index_time} + ${item_index} minutes" "+%Y-%m-%dT%H:%M:%SZ") + if [[ ${item} =~ ^\[(.+)\] ]]; then title="${BASH_REMATCH[1]}" fi @@ -80,11 +85,13 @@ EOF <item> <title>${title}</title> <link>${url}</link> - <pubDate>$(date -d "today" '+%a, %d %b %Y 00:00:00 %z')</pubDate> + <pubDate>${current_time}</pubDate> </item> EOF done + # $(date -d "today" '+%a, %d %b %Y 00:00:00 %z') + echo "</channel></rss>" exit |