2 ms·
. flex -8Cem 095.l cc -O3 -std=c89 -pedantic -W -Wall lex.yy.c -pipe -static -s -o yy095 curl -A"" -s https://news.ycombinator.com|yy095|sqlite3
by 1vuio0pswjnm7 2y ago
.
flex -8Cem 095.l
cc -O3 -std=c89 -pedantic -W -Wall lex.yy.c -pipe -static -s -o yy095
curl -A"" -s https://news.ycombinator.com|yy095|sqlite3 0.db
curl -A"" -s https://news.ycombinator.com/newest|yy095|sqlite3 0.db
Example usage, assuming "the" is a keyword/string of interest
# get count of stories with keyword/string
echo select count\(\) from t1 where title like \'%the%\'|sqlite3 0.db
# get count of all stories with keyword/string in the title that are flagged
echo select count\(id\) from t1 where title like \'%the%\' and status like \'%[flagged]%\'|sqlite3 0.db
# get list of all stories with keyword/string in the title that are flagged
echo select id,title from t1 where title like \'%the%\' and status like \'%[flagged]%\'|sqlite3 0.db
# get status counts for stories with keyword/string in title
echo select status from t1 where title like \'%the%\' order by status|sqlite3 0.db|uniq -c
415 [dead]
17 [dupe]
12 [dupe] [dead]
23 [flagged]
131 [flagged] [dead]
2320 [ok]
# get status counts for stories with keyword/string in title for the last week
x=$((`date +%s`-604800))
echo select status from t1 where title like \'%the%\' and time \> $x order by status|sqlite3 0.db|uniq -c