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

Re: shortcut Google search result snooping



In [emacs-w3m : No.11798] jidanni@xxxxxxxxxxx wrote:
> Nowadays, e.g.,
> http://www.google.com.tw/search?q=GeoPDF&ie=utf-8&oe=utf-8 just leads to
> a page full of Google snoop links like
> http://www.google.com.tw/url?q=http://en.wikipedia.org/wiki/GeoPDF&sa=U&ei=_meKT5W3IZDSmAXD2uXqCQ&ved=0CBYQFjAA&usg=AFQjCNHWLQW_0J920pZEjdztKO-oTTTGgA
> Maybe there should be some functionality that automatically rewrites
> this back to a direct call to http://en.wikipedia.org/wiki/GeoPDF .

> I don't think letting Google know our User-Agent is worth the extra connection.

That's easy to do using w3m-filter:

(setq w3m-use-filter t)
(require 'w3m-filter)

(defun w3m-filter-google (url)
  "Extract real urls in Google search."
  (goto-char (point-min))
  (while (re-search-forward "\\(<a[\t\n ]+href=\"\\)/url\\?q=\\([^&]+\\)"
			    nil t)
    (replace-match "\\1\\2\"")))

This replaces the default Google filter function that w3m-filter.el
has been providing thus far, but I think this becomes the new default.
Does anyone know this causes any disadvantage to users?