Fix Quoting problem in title

Add jo as dependency. Fix crash with below title
[$] Libxml2's "no security embargoes" policy Updates
This commit is contained in:
2025-07-03 09:35:46 -04:00
parent 978a8e5c7c
commit 13a79f0d34
2 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ available to all. This script is for [lwn][0].
* [yq][1] * [yq][1]
* [miller][2] * [miller][2]
* [jo][3]
### Usage ### Usage
@ -41,3 +42,4 @@ Marking as unread. entry: 3060 title: [$] An end to uniprocessor configurations
[0]: https://lwn.net [0]: https://lwn.net
[1]: https://github.com/mikefarah/yq [1]: https://github.com/mikefarah/yq
[2]: https://github.com/johnkerl/miller [2]: https://github.com/johnkerl/miller
[3]: https://github.com/jpmens/jo

4
run.sh
View File

@ -16,12 +16,12 @@ process() {
echo "Updating title. entry: $eid title: $title" echo "Updating title. entry: $eid title: $title"
curl --fail -o /dev/null -s -X PUT "$MURL/v1/entries/$eid" \ curl --fail -o /dev/null -s -X PUT "$MURL/v1/entries/$eid" \
--json "$(printf '{"title":"%s"}' "${title/$/✓}")" \ --json "$(jo title="${title/$/✓}")" \
-H "X-Auth-Token: $MINIFLUX_TOKEN" -H "X-Auth-Token: $MINIFLUX_TOKEN"
echo "Marking as unread. entry: $eid title: $title" echo "Marking as unread. entry: $eid title: $title"
curl --fail -s -X PUT "$MURL/v1/entries" \ curl --fail -s -X PUT "$MURL/v1/entries" \
--json "$(printf '{"entry_ids":[%s],"status":"unread"}' "$eid")" \ --json "$(jo entry_ids="$(jo -a "$eid")" status=unread)" \
-H "X-Auth-Token: $MINIFLUX_TOKEN" -H "X-Auth-Token: $MINIFLUX_TOKEN"
} }