top  Index  Search  Changes  RSS  Login

howm wiki - Polipo Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

google の検索結果のリンク(http://www.google.com/url?q=http://○×△□…)を踏んだとき, google 経由でなく直接 http://○×△□… を見にいってほしい.
polipo でリダイレクトするならこんな感じ?

$ cat /usr/local/bin/polipo_redirector.rb
#!/usr/bin/ruby

require 'cgi'

$r = %r!^http://www\.google\.com/url\?!

ARGF.each{|url|
   url.chomp!
   url.sub! $r, '' and url = CGI.parse(url)['q'].first
   puts url
   $stdout.flush
}
$ ls -l /usr/local/bin/polipo_redirector.rb
-rwxr-xr-x 1 root staff 291 2012-02-24 00:00 /usr/local/bin/polipo_redirector.rb*
$ cat /etc/polipo/config | grep redirector
redirector = /usr/local/bin/polipo_redirector.rb
$ sudo /etc/init.d/polipo restart

----
* w3m 単体の個人設定でできればいいのになあ…
{{comment}}
----