ff
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Michael Grote 2024-05-07 02:53:07 +02:00
parent ba6f13bf02
commit f115b2ac50

View file

@ -183,6 +183,11 @@ function filter_entries {
marked_entries+=" $(echo "$unread_entries" | jq --arg url "$url" --arg suchbegriff "$suchbegriff" '.entries[] | select(.feed.site_url | ascii_downcase | contains($url)) | select(.content | ascii_downcase | contains($suchbegriff)) | .id' )"
fi
fi
# sortiere und forme marked_entries um
# https://unix.stackexchange.com/questions/353321/remove-all-duplicate-word-from-string-using-shell-script
# entfernt doppelte eintraege innerhalb einer zeile
marked_entries=$(echo marked_entries | xargs -n1 | sort -u | xargs | sed -r 's/\s/\, /g')
echo $marked_entries
done
}
function mark_as_read {
@ -193,13 +198,11 @@ function mark_as_read {
if [[ $MF_DEBUG -eq 1 ]]; then
echo "[DEBUG] mark entries as read"
echo "[DEBUG] marked entry ids: $marked_entries"
# https://unix.stackexchange.com/questions/353321/remove-all-duplicate-word-from-string-using-shell-script
# entfernt doppelte eintraege innerhalb einer zeile
echo "$marked_entries" | xargs -n1 | sort -u | xargs | sed -r 's/\s/\, /g'
echo "$marked_entries"
fi
# wenn NICHT leer
# sed wandelt 123 345 456 in 123, 245, 345 um.
if [[ $(echo "$marked_entries" | xargs -n1 | sort -u | xargs | sed -r 's/\s/\, /g') ]]; then
if [[ -n "$marked_entries" ]]; then
curl --request PUT --silent --header "X-Auth-Token: $MF_AUTH_TOKEN" --header "Content-Type: application/json" --data "{\"entry_ids\": [$(echo "$marked_entries" | xargs -n1 | sort -u | xargs | sed -r 's/\s/\, /g')], \"status\": \"read\"}" "$MF_API_URL/entries"
# gebe entry-titel aus
for i in $(echo "$marked_entries" | xargs -n1 | sort -u | xargs); do
@ -232,3 +235,7 @@ case "$1" in
sleep "$MF_SLEEP"
done
esac
# curl --request PUT --header "X-Auth-Token: hLPp23gO8QeZWPYXXXXXXXMs0jG0XTYgNZBgRA=" --header "Content-Type: application/json" --data '{"entry_ids":[388229, 388211], "status":"read"}' https://miniflux.mgrote.net/v1/entries