(defun delicious-post-url () (interactive) (if (null (w3m-anchor)) (message "no anchor at point") (let ((url (w3m-anchor))) (if (w3m-url-valid url) (progn (w3m-goto-url (concat "http://delicious.com/save?url=" url))) (message "no URL at point!")))))
- BradClawsie (April 2008)
See also DeliciousEl.
I’m not going to go so far as to delete the entries below (which seems impolite), but suffice to say, as of the migration from del.icio.us to delicious.com, these methods are not valid
Normally, cookie support is disbaled in emacs-w3m, so we need to enable it:
(setq w3m-use-cookies t) (setq w3m-cookie-accept-bad-cookies t)
Then you can use a command like this to bookmark pages to Delicious (please change
‘hober’ to your Delicious username):
(defun ted-delicious-url () "Bookmark this page with del.icio.us." (interactive) (w3m-goto-url (concat "http://del.icio.us/hober?" "url=" (w3m-url-encode-string w3m-current-url) "&title=" (w3m-url-encode-string w3m-current-title))))
I bind this function to
‘a’, which is the normal w3m bookmark binding:
(eval-after-load "w3m" '(define-key w3m-info-like-map "a" 'ted-delicious-url))
I’ve added a bit to this function, so that you can launch it when point is at a url in any buffer. It visits the url in w3m (to get the title information from the page), then goes to your bookmark posting page. Again, change
‘johnsu01’ to your username.
(defun /john-delicious-url () "Post either the url under point or the url of the current w3m page to delicious." (interactive) (let ((w3m-async-exec nil)) (if (thing-at-point-url-at-point) (unless (eq (current-buffer) (w3m-alive-p)) (w3m-goto-url (thing-at-point-url-at-point)))) (w3m-goto-url (concat "http://del.icio.us/johnsu01?" "url=" (w3m-url-encode-string w3m-current-url) "&title=" (w3m-url-encode-string w3m-current-title)))))