also write the whole json
This commit is contained in:
parent
a8f4bc5e30
commit
972a6226a2
|
@ -29,7 +29,7 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jqFilter='.dates[].games[] | "\(.gamePk),\(.status.detailedState)"'
|
jqFilter='.dates[].games[] | "\(.gamePk)\(.status.detailedState)\(.)"'
|
||||||
fmt="OFS=\",\"; print \$1, \"$team\", \$2, 0"
|
fmt="OFS=\"\"; print \$1, \"$team\", \$2, \$3, 0"
|
||||||
save="\"sqlite3 $db '.import --csv /dev/stdin games'\""
|
save="\"sqlite3 $db '.mode ascii' '.separator ' '.import /dev/stdin games'\""
|
||||||
mlblive schedule -t $team | jq -r "$jqFilter" | awk -F , "{$fmt | $save; close($save)}"
|
mlblive schedule -t $team | jq -r "$jqFilter" | awk -F "{$fmt | $save; close($save)}"
|
||||||
|
|
|
@ -20,6 +20,7 @@ create table if not exists games (
|
||||||
gamePk integer,
|
gamePk integer,
|
||||||
teamId text,
|
teamId text,
|
||||||
state text,
|
state text,
|
||||||
|
json text,
|
||||||
posted integer,
|
posted integer,
|
||||||
unique (teamId, gamePk) on conflict ignore
|
unique (teamId, gamePk) on conflict ignore
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue