write some simple highlight scripts
This commit is contained in:
parent
8c5292f9c8
commit
70548bda02
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
while getopts 'd:' opt
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
d)
|
||||||
|
db=$OPTARG
|
||||||
|
;;
|
||||||
|
?)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -z $db ]]
|
||||||
|
then
|
||||||
|
echo "$0:" '-d is required' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sqlite3 $db < posthighlights.sql | awk -F '{printf "%s\n\n%s\n", $1, $3}'
|
|
@ -0,0 +1,16 @@
|
||||||
|
.separator
|
||||||
|
|
||||||
|
begin;
|
||||||
|
select
|
||||||
|
json ->> 'headline',
|
||||||
|
json ->> 'id',
|
||||||
|
json ->> 'url'
|
||||||
|
from highlights
|
||||||
|
where
|
||||||
|
json ->> 'url' is not null and
|
||||||
|
posted = 0;
|
||||||
|
|
||||||
|
update highlights
|
||||||
|
set posted = 1
|
||||||
|
where posted = 0;
|
||||||
|
commit;
|
Loading…
Reference in New Issue