w3m その8 (738レス)
w3m その8 http://mevius.5ch.net/test/read.cgi/unix/1185784998/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
657: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 01:23:44.21 あ、num=10のままになってるな。 これでもうもう間違いないっしょ。 だからnumは自分で変えてくんろ。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/657
658: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 01:50:58.58 UTF-8に変える所にgは要らないな。このぐらいじゃ貼らないけど。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/658
659: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 01:57:53.91 てか直さないと出力の中のも変えちゃうか。あーまた間違えてる。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/659
660: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 02:05:07.89 #!/bin/zsh UNIQ=$(basename $( factor $PPID |md5sum )) if test "${QUERY_STRING%%=*}" != $UNIQ; then # default. URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100" else case "$QUERY_STRING" in ${UNIQ}=\&rotate\&*) # 次のページへ、時間指定等の対応。 URL="https://www.google.co.jp/search?$( cut -d '&' -f 3- <<<$QUERY_STRING )";; ${UNIQ}=\&decode\&*) # ここから再検索して下さいの対処。 URL="https://www.google.co.jp/search?\ $(nkf --url-input <( sed 's/\([^&]*&\)\{2\}//; s/%25/%/g' <<<$QUERY_STRING ))";; ${UNIQ}=1\&*) # formから流れてくるもの。 URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; esac fi <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: VIEW w3m-control: PIPE_BUF sed 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="1">%;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/url?q=/search%3F\(q%3D[^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=\&decode\&\2,;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g;'\ 's%\(<a [^>]*href="\)/search?\([^"]*"\)'\ '%\1file:///cgi-bin/google.zsh?${UNIQ}=\&rotate\&\2%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/660
661: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 02:08:37.88 良かった。気づいて。これは申し訳ないレベルだった。 よしもういいだろ。もういいだろ。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/661
662: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 14:22:20.68 #!/bin/zsh # より短く分かりやすく、無駄な事をしてる部分を削った。 UNIQ=$(basename $( factor $PPID |md5sum )) if test "${QUERY_STRING%%=*}" != $UNIQ; then # default. URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100" else case "$QUERY_STRING" in # formから流れてくるもの。# 次のページへ、時間指定等の対応。 ${UNIQ}=form\&*|${UNIQ}=rotate\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=decode\&*) # ここから再検索して下さいの対処。 URL="https://www.google.co.jp/search?\ $(nkf --url-input <( sed 's/\([^&]*&\)\{2\}//; s/%25/%/g' <<<$QUERY_STRING ))";; esac fi <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: VIEW w3m-control: PIPE_BUF sed 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/url?q=/search%3F\(q%3D[^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=decode\&\2,;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g;'\ 's%\(<a [^>]*href="\)/search?\([^"]*"\)'\ '%\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/662
663: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 15:01:09.86 #!/bin/zsh # 直し忘れの修正。 UNIQ=$(basename $( factor $PPID |md5sum )) if test "${QUERY_STRING%%=*}" != $UNIQ; then # default. URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100" else case "$QUERY_STRING" in # formから流れてくるもの。# 次のページへ、時間指定等の対応。 ${UNIQ}=form\&*|${UNIQ}=rotate\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=decode\&*) # ここから再検索して下さいの対処。 URL="https://www.google.co.jp/search?\ $(nkf --url-input <( sed 's/[^&]*&//; s/%25/%/g' <<<$QUERY_STRING ))";; esac fi <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: VIEW w3m-control: PIPE_BUF sed 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/url?q=/search%3F\(q%3D[^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=decode\&\2,;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g;'\ 's%\(<a [^>]*href="\)/search?\([^"]*"\)'\ '%\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/663
664: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 15:35:13.55 #!/bin/zsh # ごめんこれだけで良かったの修正。 UNIQ=$(basename $( factor $PPID |md5sum )) case "$QUERY_STRING" in # formから流れてくるもの。# 次のページへ、時間指定等の対応。 ${UNIQ}=form\&*|${UNIQ}=rotate\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=decode\&*) # ここから再検索して下さいの対処。 URL="https://www.google.co.jp/search?\ $(nkf --url-input <( sed 's/[^&]*&//; s/%25/%/g' <<<$QUERY_STRING ))";; *) URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100";; esac <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: VIEW w3m-control: PIPE_BUF sed 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/url?q=/search%3F\(q%3D[^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=decode\&\2,;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g;'\ 's%\(<a [^>]*href="\)/search?\([^"]*"\)'\ '%\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/664
665: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 19:35:00.39 一応簡単に説明しくおくと、最近googleで検索してもlink先へ飛べなくなった事への対 処をしている。googleが送ってきたソースをsedで加工して表示している。<a></a>の中に <div>があってそれが原因なので消しているだけ。 他にそのままgoogleを開いたまま検索した場合、検索は出来るが出てくるソースはまた 上で書いた問題を含む為、cgiを経由するように書き換える、だからまた同じようにsedで 加工されたページが表示される。その繰り返し。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/665
666: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 19:37:27.95 いや、原因違うかも。まあ動いてるから良しとする。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/666
667: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 19:40:18.57 やっぱちょっと違うな。<div></div>に変えて動いてるわけだからな。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/667
668: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 19:41:22.71 これは動く。 <a href='test.html'>test<div></div></a> これ駄目。 <a href='test.html'><div>test</div></a> http://mevius.5ch.net/test/read.cgi/unix/1185784998/668
669: 名無しさん@お腹いっぱい。 [] 2019/09/07(土) 19:50:46.58 ただ面倒なので、duckduckgoがお勧め。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/669
670: 名無しさん@お腹いっぱい。 [] 2019/09/08(日) 01:27:48.66 #!/bin/zsh # factorを変更しただけ。 UNIQ=$(basename $(ps -p $PPID -o pid,ppid,egroup,euser,lstart |md5sum)) case "$QUERY_STRING" in # formから流れてくるもの。# 次のページへ、時間指定等の対応。 ${UNIQ}=form\&*|${UNIQ}=rotate\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=decode\&*) # ここから再検索して下さいの対処。 URL="https://www.google.co.jp/search?\ $(nkf --url-input <( sed 's/[^&]*&//; s/%25/%/g' <<<$QUERY_STRING ))";; *) # default. URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100";; esac <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: VIEW w3m-control: PIPE_BUF sed 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/url?q=/search%3F\(q%3D[^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=decode\&\2,;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g;'\ 's%\(<a [^>]*href="\)/search?\([^"]*"\)'\ '%\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/670
671: 名無しさん@お腹いっぱい。 [] 2019/09/08(日) 01:40:19.68 #!/bin/zsh # bsdのmanにはeuserとかの指定の仕方は無かったので変えただけ。 # そもそもたぶんここ要らないと思うんだけど改造する時の使い道としてまあやっとく。 UNIQ=$(basename $(ps -p $PPID -o pid,ppid,group,user,lstart |md5sum)) case "$QUERY_STRING" in # formから流れてくるもの。# 次のページへ、時間指定等の対応。 ${UNIQ}=form\&*|${UNIQ}=rotate\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=decode\&*) # ここから再検索して下さいの対処。 URL="https://www.google.co.jp/search?\ $(nkf --url-input <( sed 's/[^&]*&//; s/%25/%/g' <<<$QUERY_STRING ))";; *) # default. URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100";; esac <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: VIEW w3m-control: PIPE_BUF sed 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/url?q=/search%3F\(q%3D[^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=decode\&\2,;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g;'\ 's%\(<a [^>]*href="\)/search?\([^"]*"\)'\ '%\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/671
672: 名無しさん@お腹いっぱい。 [] 2019/09/08(日) 01:55:42.21 このぐらいの変更で貼り付けないけど、gidとuid使ったほうがいいのかも。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/672
673: 名無しさん@お腹いっぱい。 [] 2019/09/08(日) 01:57:51.40 UNIQ=$(basename $(ps -p $PPID -o pid,ppid,gid,uid,lstart |md5sum)) ここの話しね。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/673
674: 名無しさん@お腹いっぱい。 [] 2019/09/08(日) 02:52:39.37 UNIQ=$(printf $(ps -p $PPID -o pid,ppid,lstart |md5sum)) このぐらいでいいな。後printfの方が速いな。 いまいちここ好きじゃなんだよな。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/674
675: 名無しさん@お腹いっぱい。 [] 2019/09/08(日) 15:05:16.58 #!/bin/zsh # すまんnkfとか無くてももっと簡単な事だった。 # 後<span>を削る必要は無いけど扱いやすくなるから残しとく。 UNIQ=$(printf $(ps -p $PPID -o pid,ppid,lstart |md5sum)) case "$QUERY_STRING" in # formから流れてくるもの。 ${UNIQ}=form\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=rotate\&*) # 次のページへ、ここから再検索して下さい、時間指定等の対応。 URL="https://www.google.co.jp/$( cut -d '&' -f 2- <<<$QUERY_STRING )";; *) # default. URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100";; esac <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: VIEW w3m-control: PIPE_BUF sed 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/\(search?\|url?q=/search%3F\)\([^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2\3,g;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/675
676: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 02:05:35.75 最後にちょっとだけ拡張してみた。これでそろそろ辞めるわ。 変数大文字ですまんな、なんかそうなってしまった。 まあまた間違いのラッシュだろけど。 現在のurlが一番上に表示されるようにしたからそれを見ながら、 二つ目のformにsedに渡す文字列を入力してsubmitするとその変更したurlに変わる。 だからs/ja/en/とすると英語のページに変わりますよという事。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/676
677: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 02:13:49.61 #!/bin/zsh # やられた停電だよ。まじか。 UNIQ=$(printf $(ps -p $PPID -o pid,ppid,lstart |md5sum)) case "$QUERY_STRING" in ${UNIQ}=option\&*) URL_HOLD=$(nkf --url-input <(sed 's%[^&]*&field=\([^&]*\)&.*%\1%' <<<$QUERY_STRING)) URL=$(sed $(nkf --url-input <(cut -d '&' -f 3 <<<$QUERY_STRING |tr '+' ' ')) <<<$URL_HOLD) test -z "$URL" && URL=$URL_HOLD;; ${UNIQ}=form\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=rotate\&*) URL="https://www.google.co.jp/$( cut -d '&' -f 2- <<<$QUERY_STRING )";; *) URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100";; esac http://mevius.5ch.net/test/read.cgi/unix/1185784998/677
678: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 02:14:23.25 <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: EXTERN echo %s |xsel -s w3m-control: VIEW w3m-control: PIPE_BUF sed "s,<body [^>]*>,&\$(xsel -s |sed "s/&/\\\\\&/g")<br />,;"\ 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's,</form>,&<form action="file:///cgi-bin/google.zsh">'\ '<input name=$UNIQ value="option" type=hidden>'\ '<input name=field value='"\$(xsel -s |sed "s/&/\\\\\&/g")"' type=hidden>'\ '<input type=text></form>,;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/\(search?\|url?q=/search%3F\)\([^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2\3,g;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/678
679: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 02:17:41.26 そうだった。xsel -s使ってるから。xsel -sの内容消えるからね。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/679
680: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 02:43:47.91 #!/bin/zsh UNIQ=$(printf $(ps -p $PPID -o pid,ppid,lstart |md5sum)) case "$QUERY_STRING" in ${UNIQ}=option\&*) URL_HOLD=$(nkf --url-input <(sed 's%[^&]*&field=\([^&]*\)&.*%\1%; s/%25/%/g' \ <<<$QUERY_STRING)) URL=$(sed $(nkf --url-input <(cut -d '&' -f 3 <<<$QUERY_STRING |tr '+' ' ')) <<<$URL_HOLD) echo $QUERY_STRING>>$HOME/debug echo $URL>>$HOME/debug echo $URL_HOLD>>$HOME/debug test -z "$URL" && URL=$URL_HOLD;; ${UNIQ}=form\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=rotate\&*) URL="https://www.google.co.jp/$( cut -d '&' -f 2- <<<$QUERY_STRING )";; *) URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100";; esac http://mevius.5ch.net/test/read.cgi/unix/1185784998/680
681: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 02:44:15.88 <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: EXTERN echo %s |xsel -s w3m-control: VIEW w3m-control: PIPE_BUF sed "s,<body [^>]*>,&\$(xsel -s |sed "s/&/\\\\\&/g")<br />,;"\ 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's,</form>,&<form action="file:///cgi-bin/google.zsh">'\ '<input name=$UNIQ value="option" type=hidden>'\ '<input name=field value='"\$(xsel -s |sed "s/&/\\\\\&/g")"' type=hidden>'\ '<input type=text></form>,;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/\(search?\|url?q=/search%3F\)\([^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2\3,g;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF http://mevius.5ch.net/test/read.cgi/unix/1185784998/681
682: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 03:07:59.08 >>675で完成してるからな。後は余興。ノシ。PC触り過ぎてきもちわり。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/682
683: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 07:23:21.45 すまん。やっぱ寝ぼけてたな。$HOME/debugにfileを書き出してる。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/683
684: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 07:26:17.19 #!/bin/zsh UNIQ=$(printf $(ps -p $PPID -o pid,ppid,lstart |md5sum)) case "$QUERY_STRING" in ${UNIQ}=option\&*) URL_HOLD=$(nkf --url-input <(sed 's%[^&]*&field=\([^&]*\)&.*%\1%; s/%25/%/g' \ <<<$QUERY_STRING)) URL=$(sed $(nkf --url-input <(cut -d '&' -f 3 <<<$QUERY_STRING |tr '+' ' ')) <<<$URL_HOLD) test -z "$URL" && URL=$URL_HOLD;; ${UNIQ}=form\&*) URL="https://www.google.co.jp/search?$( cut -d '&' -f 2- <<<$QUERY_STRING )";; ${UNIQ}=rotate\&*) URL="https://www.google.co.jp/$( cut -d '&' -f 2- <<<$QUERY_STRING )";; *) URL="https://www.google.co.jp/search?q=$QUERY_STRING&hl=ja&biw=&bih=&gbv=1&num=100";; esac http://mevius.5ch.net/test/read.cgi/unix/1185784998/684
685: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 07:26:52.00 <<EOF Content-Type: text/plain w3m-control: GOTO $URL w3m-control: EXTERN echo %s |xsel -s w3m-control: VIEW w3m-control: PIPE_BUF sed "s,<body [^>]*>,&\$(xsel -s |sed "s/&/\\\\\&/g")<br />,;"\ 's%\(<input[^>]*\)Shift_JIS%\1UTF-8%; s%\(<form \)\([^>]*>\)'\ '%\1action="file:///cgi-bin/google.zsh" \2<input name=$UNIQ type=hidden value="form">%;'\ 's,</form>,&<form action="file:///cgi-bin/google.zsh">'\ '<input name=$UNIQ value="option" type=hidden>'\ '<input name=field value='"\$(xsel -s |sed "s/&/\\\\\&/g")"' type=hidden>'\ '<input type=text></form>,;'\ 's%\(<span[^>]*>\|</span>\)%%g; s%<div[^>]*>%%g; s%</div>%<div>&%g;'\ 's,\(<a [^>]*href="\)/\(search?\|url?q=/search%3F\)\([^"]*"\)'\ ',\1file:///cgi-bin/google.zsh?${UNIQ}=rotate\&\2\3,g;'\ 's%\(<a [^>]*href="\)/url?%\1https://www.google.co.jp/url?%g' w3m-control: VIEW $( printf '%s\n' 'w3m-control: DELETE_PREVBUF'{,,,} ) EOF # もう間違っててもちょっと離れる。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/685
686: 名無しさん@お腹いっぱい。 [] 2019/09/09(月) 07:30:02.79 まじすまんな。上の$HOME/debugにfileを書いちゃってるから。 まあダメージないだろうけど。この失敗は教訓にしよう。 http://mevius.5ch.net/test/read.cgi/unix/1185784998/686
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 52 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.011s