fix order and make yq work as json

This commit is contained in:
2026-01-15 12:47:52 -05:00
parent 02065089e1
commit 486960bd87

7
run.sh
View File

@@ -39,7 +39,8 @@ filter_entries() {
mlr --l2n \ mlr --l2n \
filter '$title =~ "\[\$\]"' \ filter '$title =~ "\[\$\]"' \
+ filter -s w1="$1" -s w2="$2" '$published_at > @w2 && $published_at < @w1' \ + filter -s w1="$1" -s w2="$2" '$published_at > @w2 && $published_at < @w1' \
+ cut -of id,title + cut -of id,title \
+ tac
} }
main() { main() {
@@ -56,9 +57,9 @@ main() {
curl -s --fail "$MURL/v1/feeds/$FID/entries" \ curl -s --fail "$MURL/v1/feeds/$FID/entries" \
--url-query limit=150 \ --url-query limit=150 \
--url-query order=id \ --url-query order=id \
--url-query direction=asc \ --url-query direction=desc \
-H "X-Auth-Token: $TOKEN" | -H "X-Auth-Token: $TOKEN" |
yq '.entries[]' | yq -pj -oj '.entries[]' |
filter_entries "$w1" "$w2" | filter_entries "$w1" "$w2" |
while read -r eid title; do while read -r eid title; do
echo "processing entry: $eid title: $title" echo "processing entry: $eid title: $title"