aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xblogrss7
1 files changed, 3 insertions, 4 deletions
diff --git a/blogrss b/blogrss
index 36c90e3..b4e1808 100755
--- a/blogrss
+++ b/blogrss
@@ -67,18 +67,17 @@ if [[ -f $FEEDN ]]; then
rm $FEEDN
fi
touch $FEEDN
-mapfile -t ARTICLEARRAY < <(ls -t "$ARTDR"/*.html)
+mapfile -t ARTICLEARRAY < <(ls -t --time=birth "$ARTDR"/*.html)
postNum=0
for POSTS in "${ARTICLEARRAY[@]}"; do
((postNum+=1))
POST=$POSTS
POSTTIT="$(grep -o '<h2>.*</h2>' $POST | sed 's/\(<h2>\|<\/h2>\)//g')"
POSTDAT="$(grep -o '<h3>.*</h3>' $POST | sed 's/\(<h3>\|<\/h3>\)//g')"
- # extract from first <h4> to last </p>
- POSTDES="$(awk '/<h4>/,/<\/p>/' $POST)"
+ # extract article html
+ POSTDES="$(awk '/<article>/,/<\/article>/' $POST | sed -E -e '/(<h2|<h3|article\>)/d')"
POSTNAM="$(htmlentities "${POST##*/}")"
POSTTIT="$(htmlentities "$POSTTIT")"
- POSTDES="$(htmlentities "$POSTDES")"
POSTADD="$YLINK/$POSTNAM"
builditem "$POST"
done