Skip to content

Instantly share code, notes, and snippets.

@Nemolog
Created October 23, 2008 13:28
Show Gist options
  • Save Nemolog/19017 to your computer and use it in GitHub Desktop.
Save Nemolog/19017 to your computer and use it in GitHub Desktop.
Twine Search (semantic web)
CmdUtils.CreateCommand({
//nome del comando
name: "TwineSearch",
homepage: "http://bytezone.plumfake.net/",
author: { name: "Mauro Rubin", email: "mauro.rubin@plumfake.net"},
help: "Se ne volete saperne di più andate su http://bytezone.plumfake.net/",
//definisco il tipo di parametro passato (in questo caso "noun_arb_text": testo semplice)
takes: {"qualcosa di interessante": noun_arb_text},
//descrizione che apparirà sulla console
preview: function( pblock, ricerca ) {
//aggiorno la console in tempo reale
pblock.innerHTML = "Ricerca Semantica su twine: " + ricerca.text;
},
//eseguo la ricerca
execute: function( ricerca ) {
var twineUrl = "http://www.twine.com/?interests=" + ricerca.text;
Utils.openUrlInBrowser(twineUrl );
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment