[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shortcut Google search result snooping
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Wed, 18 Apr 2012 07:51:57 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 11811
- References: <b4mvckznpev.fsf@xxxxxxx> <87fwc2m1o4.fsf@xxxxxxxxxxx>
In [emacs-w3m : No.11809] jidanni@xxxxxxxxxxx wrote:
> OK, to get it working in the Debian version, in .emacs-w3m one should add
> (eval-after-load "w3m-filter"
> '(defun w3m-filter-google (url)
[...]
This will make it a little bit faster and work also for the images
search. :)
(eval-after-load "w3m-filter"
'(progn
(setq w3m-filter-rules
'(("\\`https?://[a-z]+\\.google\\." w3m-filter-rules)))
(defun w3m-filter-google (url)
"Extract real urls in Google search."
(goto-char (point-min))
(while (re-search-forward "\
\\(<a[\t\n ]+href=\"\\)/\\(?:imgres\\?imgurl\\|url\\?q\\)=\\([^&]+\\)[^>]+>"
nil t)
(replace-match "\\1\\2\">")))))