[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: shortcut Google search result snooping

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"
     (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\">")))))