2 ms·
/*```````````yahoo/bingj```````````*/ <M19>"<a style=\"line-height:26px\" class=\" d-ib fz-20 lh-26 td-hu tc va-bot mxw-100p\" href=\""[^\"]+ { w=0;v++
by 1vuio0pswjnm7 3y ago
/*```````````yahoo/bingj```````````*/
<M19>"<a style=\"line-height:26px\" class=\" d-ib fz-20 lh-26 td-hu tc va-bot mxw-100p\" href=\""[^\"]+ {
w=0;v++;
y=0;for(x=85;x<yyleng;x++)if(y<255){url[y]=yytext[x];y++;};urllen=y;
}
<M19>aria-label=\"[^\"]+ if(v){
y=0;for(x=12;x<yyleng;x++)if(y<255){desc[y]=yytext[x];y++;};desclen=y;
}
<M19>\<span[ ]class=.{33}fc-obsidian {
v++;
CDp8iULPuCinsert(19);
fwrite(url,1,urllen,yyout);
if(urllen==255)fwrite(" #[TRUNCATED]",1,13,yyout);
fwrite("','",1,3,yyout);
}
<M19>"ptb-1u td-n td-n-h\" href=\""[^\"]+ {
w++;
fwrite("https://cc.bingj.com/cache.aspx?",1,32,yyout);
z=0;for(x=26;x<yyleng;x++)
{
if(yytext[x]==38)z++;
if(z==1)if(yytext[x]!=38)putc(yytext[x],yyout);
if(z==4)putc(yytext[x],yyout);
}
fwrite("');\n",1,4,yyout);
}
<M19>"</li>" if(v){
if(!w){
fwrite(desc,1,desclen,yyout);
if(desclen==255)fwrite(" [TRUNCATED]",1,12,yyout);
fwrite("');\n",1,4,yyout);
}
v=0;
}
/*`````````yandex``````````*/
<M13>accessKey=.{3}[ ]tabindex=.{3}[ ]href=\"[^\"]+|.{8}link\"[ ]tabindex=.{3}[ ]href=\"[^\"]+ {
CDp8iULPuCinsert(13);
for(x=33;x<yyleng;x++){putc(yytext[x],yyout);if(yytext[x]==39)putc(39,stdout);};
fwrite("','",1,3,yyout);
}
<M13>OrganicTextContentSpan\"> jmp M13_DESC;
<M13_DESC><\/span> fwrite("');\n",1,4,yyout);jmp M13;
<M13_DESC><[^>]+>
<M13_DESC>. putc(yytext[0],yyout);
To test:
#!/bin/sh
COUNTRYCODE=
test $1||exec sed -n '/^ *;;/p' ${0##*/};
read x;
case $1 in :)
;;13) # yandex
shift
yy084 13 "$x p=${1-1}"
x=$(echo "$x"|sed 's/ /+/g;s/++/+/g');
curl -si04A "" "https://yandex.com/search/?text=$x&p=${1-1}&family=0"
;;19) # yahoo
shift
yy084 19 "$x b=${1-1}";
x=$(echo "$x"|sed 's/ /+/g;s/++/+/g');
if test $COUNTTRYCODE
then curl -si04A "" "https://$COUNTRYCODE.search.yahoo.com/search?p=$x&n=100&b=${1-1}"
else curl -si04A "" "https://search.yahoo.com/search?p=$x&n=100&b=${1-1}"
fi
esac
echo research|1.sh 13 > 13.serp
echo research|1.sh 19 > 19.serp
cat [0-9]*.serp|yy084|sqlite3 test.db