aboutsummaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/build.sh b/build.sh
index b5a9a42..8fedef5 100755
--- a/build.sh
+++ b/build.sh
@@ -631,9 +631,9 @@ RSSHEAD
sort -r "${list_file}" | head -n 20 | while IFS= read -r line; do
# Line format: - [DATE] [TITLE](URL)
local date title url
- date="$(echo "${line}" | grep -oP '\[\K[0-9]{4}-[0-9]{2}-[0-9]{2}(?=\])')"
- title="$(echo "${line}" | grep -oP '\]\s+\[\K[^\]]+(?=\]\()')"
- url="$(echo "${line}" | grep -oP '\]\(\K[^)]+(?=\))')"
+ date="$(echo "${line}" | sed -n 's/.*\[\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\)\].*/\1/p')"
+ title="$(echo "${line}" | sed -n 's/.*\] \[\([^]]*\)\](.*/\1/p')"
+ url="$(echo "${line}" | sed -n 's/.*\](\([^)]*\)).*/\1/p')"
[[ -z "${date}" || -z "${title}" || -z "${url}" ]] && continue
# RFC 2822 date from YYYY-MM-DD