WThreeMDelicious

The following elisp will allow you to place your cursor over a url in w3m and then bookmark it. This has been tested with the new delicious.com, migrated from del.icio.us. Note that the delicious.com site uses javascript-generated form submission elements (which obviously are not functional in w3m), but I have had good luck simply entering the fields and then using w3m-form-submit to submit the data. Here’s the code:

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

Note that you will need to sign-in to delicious.com, and you will be redirected to sign-in if you do not have a delicious.com cookie. you will need to set (setq w3m-use-cookies t) and once again use w3m-form-submit to submit the sign-in form, where the submit element is, once again, generated by javascript.

- 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


Delicious (http://del.icio.us/) is a minimalist social bookmarks manager which is very, very spiffy. Here’s how I’ve convinced emacs-w3m (WThreeM) to let me bookmark sites with Delicious:

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)))))