simplify a little
This commit is contained in:
parent
8dd484ff96
commit
88870285c8
|
@ -29,6 +29,13 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# summary of what these variables do in the awk script:
|
||||||
|
# get: download the highlight's url, and wait until it is downloaded before
|
||||||
|
# continuing
|
||||||
|
# fmt: print the text of the post
|
||||||
|
# post: use toot to post the text and the downloaded highlight (also wait until
|
||||||
|
# the toot is posted before continuing)
|
||||||
|
# rm: delete the downloaded highlight
|
||||||
get='print $3 | "xargs curl >" $2; close("xargs curl >" $2)'
|
get='print $3 | "xargs curl >" $2; close("xargs curl >" $2)'
|
||||||
fmt='printf "%s\n\n#baseball #highlights\n", $1'
|
fmt='printf "%s\n\n#baseball #highlights\n", $1'
|
||||||
post='"toot post -m " $2'
|
post='"toot post -m " $2'
|
||||||
|
|
|
@ -37,5 +37,7 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# grab select data from response with jq, add 0 to the end of each line (to go
|
||||||
|
# in the 'posted' db column), then write each line to db
|
||||||
jqFilter='.highlights.highlights.items | map(select(.keywordsAll[].value == "highlight"))[] | {headline, id} + {url: (.playbacks | map(select(.name == "mp4Avc"))[0].url)}'
|
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 mlbdata'"
|
mlblive content -g $gamePk | jq -Sc "$jqFilter" | sed 's/$/0/' | sqlite3 $db '.mode ascii' '.separator \n' '.import /dev/stdin mlbdata'
|
||||||
|
|
Loading…
Reference in New Issue