diff --git a/README.md b/README.md index dfa5a9e..5c099ae 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ available to all. This script is for [lwn][0]. * [yq][1] * [miller][2] +* [jo][3] ### Usage @@ -41,3 +42,4 @@ Marking as unread. entry: 3060 title: [$] An end to uniprocessor configurations [0]: https://lwn.net [1]: https://github.com/mikefarah/yq [2]: https://github.com/johnkerl/miller +[3]: https://github.com/jpmens/jo diff --git a/run.sh b/run.sh index 5377c1d..6ca82d5 100755 --- a/run.sh +++ b/run.sh @@ -16,12 +16,12 @@ process() { echo "Updating title. entry: $eid title: $title" 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" echo "Marking as unread. entry: $eid title: $title" 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" }