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

Extract more URLs from Google search



How should I rewrite

(eval-after-load "w3m-filter"
  '(progn
     (nconc w3m-filter-rules
	   '(("\\`https?://[a-z]+\\.google\\." w3m-filter-google)))
     (defun w3m-filter-google (url)
       "Extract real urls in Google search."
       (goto-char (point-min))
       (while (re-search-forward "\\(<a[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*\
href=\"\\)/\\(?:imgres\\?imgurl\\|url\\?q\\)=\\([^&]+\\)[^>]+>"
				 nil t)
      (insert (w3m-url-decode-string
	       (prog1
		   (concat (match-string 1) (match-string 2) "\">")
		 (delete-region (match-beginning 0) (match-end 0)))))))))

So it even works for the URLs in
http://groups.google.com.tw/groups?hl=zh-TW&lr=&ie=UTF-8&scoring=d&q=%E7%A9%8D%E4%B8%B9%E5%B0%BC ?