From 486960bd87878d1737944874458dc52445dac096 Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Thu, 15 Jan 2026 12:47:52 -0500 Subject: [PATCH] fix order and make yq work as json --- run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index ba8cb2d..afcbf6a 100755 --- a/run.sh +++ b/run.sh @@ -39,7 +39,8 @@ filter_entries() { mlr --l2n \ filter '$title =~ "\[\$\]"' \ + filter -s w1="$1" -s w2="$2" '$published_at > @w2 && $published_at < @w1' \ - + cut -of id,title + + cut -of id,title \ + + tac } main() { @@ -56,9 +57,9 @@ main() { curl -s --fail "$MURL/v1/feeds/$FID/entries" \ --url-query limit=150 \ --url-query order=id \ - --url-query direction=asc \ + --url-query direction=desc \ -H "X-Auth-Token: $TOKEN" | - yq '.entries[]' | + yq -pj -oj '.entries[]' | filter_entries "$w1" "$w2" | while read -r eid title; do echo "processing entry: $eid title: $title"