K-Meleon

KMeleonWiki > Resources > MacroLibrary > KmmSproose

Submitted by: rstlne



Notes:

Sproose is a search engine that allows users to vote on websites to improve search results.

The following is a set of macros to help you vote on websites in Sproose and run web searches using Sproose.

Hit CTRL-Q to run a web search using Sproose. If you have selected some text, the selected text will be the search keywords. Alternatively, if you have typed in some text on the URL bar, that text will be used. Otherwise, the macro will prompt you for the search keywords.

Hit CTRL-SHIFT-Q to vote up the current web page in Sproose.

You can also invoke Sproose commands from the document and link popup menus and from the selected text popup menu.




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

sproose.kmm

# sproose.kmm
#
# Macros for searching or voting for links at the Sproose search engine.

_sproose{
$OpenURL="http://www.sproose.com/bookmarklet?url=".urlencode($_sproose);
&OpenURL_InNew;
}

sproose_page{
menugrayed=(hostname($URL)=="");
$_sproose=$URL; &_sproose;
}

sproose_link{
$_sproose=$LinkURL; &_sproose;
}

$_sproose_searchurl="http://www.sproose.com/search?query=";

sproose_search{
$_sproose_query=$SelectedText;
$_sproose_query==""?&_sproose_typed:&_sproose_selected;
}

_sproose_selected{
$OpenURL=$_sproose_searchurl.urlencode($_sproose_query);
&OpenURL_InNew;
}

_sproose_typed{
$_sproose_query=$URLBAR;
$_sproose_query==$URL?$_sproose_query=prompt(_("Enter search query:"),_("Search Sproose")):0;
$_sproose_query==""?"":&_sproose_selected;
}

_sproose_buildmenu{
setmenu(Document,macro,"Vote for this page in Sproose",sproose_page,-1);
setmenu(LinkPopup,macro,"Vote for this link in Sproose",sproose_link,-1);
setmenu(FrameLinkPopup,macro,"Vote for this link in Sproose",sproose_link,-1);
setmenu(SelectedText,macro,"Search in Sproose",sproose_search,-1);
}

_sproose_buildaccel{
setaccel("CTRL SHIFT Q", "macros(sproose_page)");
setaccel("CTRL Q", "macros(sproose_search)");
}

$OnInit=$OnInit."_sproose_buildmenu;_sproose_buildaccel;";
$macroModules=$macroModules."sproose;";

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


Comments & Questions

K-Meleon

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