From 3c3a6062d130decc85acbd0426121a4d4c70c746 Mon Sep 17 00:00:00 2001 From: filifa Date: Fri, 26 Jul 2024 19:02:45 -0500 Subject: [PATCH] make the split/filter its own script --- content.sh | 2 +- subscribe.sh | 2 +- writedb.sh | Bin 0 -> 466 bytes 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100755 writedb.sh diff --git a/content.sh b/content.sh index 99211d3..0cc424f 100755 --- a/content.sh +++ b/content.sh @@ -27,4 +27,4 @@ then fi jqFilter='.highlights.highlights.items | map(select(.keywordsAll[].value == "highlight"))[] | {headline, id} + {url: (.playbacks | map(select(.name == "mp4Avc"))[0].url)}' -mlblive content -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | split -l 1 --filter="sqlite3 $DB '.mode ascii' '.separator ' '.import /dev/stdin highlights'" +mlblive content -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | ./writedb.sh -d $DB -t highlights -c '' diff --git a/subscribe.sh b/subscribe.sh index 1230c32..59e1b29 100755 --- a/subscribe.sh +++ b/subscribe.sh @@ -27,4 +27,4 @@ then fi jqFilter='{gamePk} + (.gameData.teams | {awayTeam: .away.teamName, homeTeam: .home.teamName}) + (.liveData.plays.allPlays[] | (.result + (.about | {atBatIndex, halfInning, inning, isComplete, isScoringPlay, hasReview})))' -mlblive subscribe -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | split -l 1 --filter="sqlite3 $DB '.mode ascii' '.separator ' '.import /dev/stdin playinfo'" +mlblive subscribe -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | ./writedb.sh -d $DB -t playinfo -c '' diff --git a/writedb.sh b/writedb.sh new file mode 100755 index 0000000000000000000000000000000000000000..2270521942c6726f5d94d18c14efb7d544f80699 GIT binary patch literal 466 zcmaKo!A`?442HSZPhm<#ghW>cw@w9d;s`?ArXAA6rIxa$O9DeYJy|v+Gz1qb&X@f8 z;eoO7L!*mnRZnJFq2urRb&@P?{z-y77&~)Pr$QXcY)W>X1h$ z3UiT4VY*g4KE2#OKkT~2BGs5dRGp5L#TpgmMCXw{K~87Jc|8PQ0xb=gS?)ck60UeuR}CE JqR4KtgfAO@eXjrj literal 0 HcmV?d00001