randomfox (randomfox) wrote,
randomfox
randomfox

K-Meleon macro to post to del.icio.us

del.icio.us is a social bookmarks manager. By posting to the service, you can both maintain a collection of bookmarks and shared them with the public at the same time.

K-Meleon requires a special macro to post to del.icio.us because the bookmarklets don't work. This macro may be bound to any keystroke, toolbar button, or menu item. Here, I bind it to F12.

If you use the macro, replace the userid in the del.icio.us URL with your own userid.

The String.fromCharCode(39) is a hack to handle website titles with quote characters in them. While both the K-Meleon macro language and Javascript can handle the quote character just fine, something seems to break nevertheless.

In macros.cfg:
Delicious{
$cmd="javascript:p='".$URL;
$cmd=$cmd."';q='".gsub("'","'+String.fromCharCode(39)+'",$TITLE);
$cmd=$cmd."';location.href='http://del.icio.us/pcheah?v=2&jump=close";
$cmd=$cmd."&url='+encodeURIComponent(p)+'&title='+encodeURIComponent(q)";
opennew($cmd);
}

In accel.cfg:
%ifplugin macros
VK_F12 = macros(Delicious)
%endif

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments