2 ms·
/* ``````````````google news```````````````` */ <M6>\[13,\"[0-9A-Za-z]+\"\],\"[^,]+,null { w=0;y=0;z=0; for(x=0;x<yyleng-4;x++) { if(yy
by 1vuio0pswjnm7 3y ago
/* ``````````````google news```````````````` */
<M6>\[13,\"[0-9A-Za-z]+\"\],\"[^,]+,null {
w=0;y=0;z=0;
for(x=0;x<yyleng-4;x++)
{
if(yytext[x]==93)z++;
if(z==1)if(yytext[x]==44)z++;
if(z==2)if(yytext[x]==34)z++;
if(z==3)if(yytext[x]!=34)z++;
if(z==4)if(w<255){desc[w]=yytext[x];w++;};
}
}
<M6>,\[[0-9]{10}\],null,\"[^\"]+ {
fwrite("INSERT or IGNORE INTO t1 VALUES(006,'",1,37,stdout);
fwrite(getenv("query"),1,querylen,stdout);
fwrite("','",1,3,yyout);
for(x=2;x<12;x++)putc(yytext[x],yyout);
fwrite("','",1,3,yyout);
for(x=20;x<yyleng;x++)putc(yytext[x],yyout);
fwrite("','",1,3,yyout);
for(x=0;x<w-2;x++)
{
if(desc[x]==39)putc(39,yyout);
if(desc[x]!=92)putc(desc[x],stdout);
}
if(w==255)fwrite(" [TRUNCATED]",1,12,yyout);
fwrite("');\n",1,4,yyout);
}
/*```````````marginalia```````````*/
<M18>class=\"title\"[ ]rel=\"nofollow[ ]external\"[ ]href=\"[^<]+ {
CDp8iULPuCinsert(18);
for(x=44;x<yyleng;x++)
{
if(yytext[x]==34)fwrite("','",1,3,yyout);
if(yytext[x]==32)if(yytext[x-1]!=32)putc(yytext[x],yyout);
if(yytext[x]!=32&&yytext[x]!=34&&yytext[x]!=62&&yytext[x]!=10)putc(yytext[x],yyout);
}
fwrite("');\n",1,4,yyout);
}
/*`````````mojeek`````````*/
<M7>"<!--rs--><li><a title=\""[^\"]+ {
CDp8iULPuCinsert(7);
for(x=23;x<yyleng;x++)
{
if(yytext[x]==39)putc(39,stdout);
putc(yytext[x],yyout);
}
fwrite("','",1,3,yyout);
}
<M7>\>[^<]+"</a></h2>" {
for(x=1;x<yyleng-9;x++)
{
if(yytext[x]==39)putc(39,stdout);
putc(yytext[x],yyout);
}
fwrite("');\n",1,4,yyout);
}
To test:
#!/bin/sh
test $1||exec sed -n '/^ *;;/p' ${0##*/};
read x;
case $1 in :)
;;6) # google news
shift
yy084 6 "$x"
x=$(echo "$x"|sed 's/ /+/g;s/++/+/g');
curl -si04A "" "https://news.google.com/search?q=$x&hl=en-US&gl=US&ceid=US:en"
;;7) # mojeek
shift
yy084 7 "$x s=${1-0}"
x=$(echo "$x"|sed 's/ /+/g;s/++/+/g');
curl -si04A "x" "https://www.mojeek.com/search?q=$x&t=40&s=${1-0}&date=1&size=1"
;;18) # marginalia
shift
yy084 18 "$x";
x=$(echo "$x"|sed 's/ /+/g;s/++/+/g')
curl -si40A "" "https://search.marginalia.nu/search?query=$x"
esac
echo research|1.sh 6 > 6.serp
echo research|1.sh 7 > 7.serp
echo research|1.sh 18 > 18.serp
cat [0-9]*.serp|yy084|sqlite3 test.db