--8<---------------cut here---------------start------------->8---
(defun my-word-lookup-megaslownik ()
"Look up a word under point with megaslownik."
(interactive)
(let ((url-adres
(concat "http://megaslownik.pl/slownik/angielsko_polski/"
(thing-at-point 'word)))
(filename (make-temp-file "url" nil ".html")))
(with-temp-file filename
(url-insert-file-contents url-adres) ; 1. works but with encoding problems
;;; (w3m-retrieve url-adres) ; 2. works ok
(goto-char (point-min))
(search-forward "
" nil t)
(forward-line 1)
(delete-region (point)
(progn
(search-forward "" nil t)
(beginning-of-line)
(point)))
(delete-region (progn
(search-forward "
" nil t)
(forward-line 1)
(point))
(progn
(search-forward "
" nil t)
(beginning-of-line)
(point)))
(delete-region (progn
(search-forward "
" nil t)
(beginning-of-line)
(point))
(progn
(search-forward "
" nil t)
(beginning-of-line)
(point)))
(delete-region (progn
(search-forward "
" nil t)
(beginning-of-line)
(point))
(progn
(search-forward "body>" nil t)
(forward-line -1)
(point))))
(w3m (concat "file://" filename))))
--8<---------------cut here---------------end--------------->8---
Thanks in advance,
Seweryn