K-Meleon

KMeleonWiki > Resources > MacroLibrary > KmmDelicious

Submitted by: rstlne



Notes:

This is a set of macros for posting bookmarks to del.icio.us, a social bookmarks manager. You need to be logged in at del.icio.us before invoking these macros.

This macro is similar to the bookmarklet provided by del.icio.us. The difference is the macro works even if you've set your bookmark options so that bookmarks open in a new layer. That setting breaks the bookmarklet.

Usage:

Hit F12 to post to del.icio.us. The macro will take the url and title from the current page and open up the form for posting to del.icio.us in a new layer.
Hit Shift-F12 to set the del.icio.us user name.
F12 will also prompt you for the del.icio.us user name if you haven't set it yet.

These macros are also accessible from the document and link popup menus.


Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text files:

delicious.kmm

# delicious.kmm
#
# Macros for posting bookmarks to del.icio.us, a social bookmarks manager.
# You need to be logged in at del.icio.us before invoking this macro.

$_delicious_conf="kmeleon.general.deliciousUser";

delicious_set{
$__userid=prompt("Set del.icio.us username to: ", "del.icio.us setup");
$__userid=="" ? "" : setpref(STRING, $_delicious_conf, $__userid);
}

_delicious_run{
$OpenURL="http://del.icio.us/".$__userid."?v=3&jump=bookmarks";
$OpenURL=$OpenURL."&url=".urlencode($__url);
$OpenURL=$OpenURL."&title=".urlencode($__title);
&OpenURL_InNew;
}

_delicious{
$__userid=getpref(STRING, $_delicious_conf);
$__userid=="" ? &delicious_set : "";
$__userid=="" ? "" : &_delicious_run;
}

delicious_page{
menugrayed=(hostname($URL)=="");
$__url=$URL;
$__title=$TITLE==""?$URL:$TITLE;
&_delicious;
}

delicious_link{
$__url=$LinkURL;
$__title=$LinkURL;
&_delicious;
}

_delicious_buildmenu{
setmenu(delicious_menu,macro,"Post to del.icio.us",delicious_page,-1);
setmenu(delicious_menu,macro,"Setup del.icio.us user name",delicious_set,-1);
setmenu(Document,inline,delicious_menu);

setmenu(LinkPopup,macro,"Post link to del.icio.us",delicious_link,-1);
setmenu(FrameLinkPopup,macro,"Post link to del.icio.us",delicious_link,-1);
}

_delicious_buildaccel{
setaccel("VK_F12", "macros(delicious_page)");
setaccel("SHIFT VK_F12", "macros(delicious_set)");
}

$OnInit=$OnInit."_delicious_buildmenu;_delicious_buildaccel;";
$macroModules=$macroModules."delicious;";

# vim:set tw=0:
# -- The End --


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.