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. The title and url are taken from the current page and the form for posting to del.icio.us will open up in a new window or layer.

Hit F12 to post to del.icio.us.
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 previously set one up.

These macros are also accessible from the document popup menu.


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.
# The title and url are taken from the current page and the form for
# posting to del.icio.us will open up in a new window or layer.
#
# Dependencies: main.kmm

$_delicious_conf="kmeleon.general.deliciousUser";

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

_delicious_run{
$_delicious_title=$TITLE==""?$URL:$TITLE;
$OpenURL="http://del.icio.us/".$_delicious_word."?v=3&jump=bookmarks&url=".urlencode($URL)."&title=".urlencode($_delicious_title);
&OpenURL_InNew;
}

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

_delicious_buildmenu{
setmenu(delicious_menu,macro,"Post to del.icio.us",delicious_cmd,-1);
setmenu(delicious_menu,macro,"Setup del.icio.us user name",delicious_set,-1);
setmenu(DocumentPopup,inline,delicious_menu);
setmenu(FrameDocumentPopup,inline,delicious_menu);
}

_delicious_buildaccel{
setaccel("VK_F12", "macros(delicious_cmd)");
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.