Reverse-sort (by date) all post-responses

This commit is contained in:
Jaidyn Ann 2024-03-28 19:47:08 -05:00
parent dafae250c5
commit 6d4398f8a7

View File

@ -148,7 +148,10 @@ media_attachments() {
# Pass a posts context JSON along stdin; out comes the response_data in JSON.
# fetch_post_context $url | context_to_responses
context_to_responses() {
jq -cr '.descendants[]'
jq '.descendants' \
| jq 'sort_by(.created_at)' \
| jq 'reverse' \
| jq -cr '.[]'
}