Skip to content

Instantly share code, notes, and snippets.

@mhausenblas
Created February 7, 2009 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhausenblas/59915 to your computer and use it in GitHub Desktop.
Save mhausenblas/59915 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "lookupNdbpedia",
takes: {"term": noun_arb_text},
homepage: "http://di2.deri.org/",
author: { name: "Michael Hausenblas", email: "michael.hausenblas@deri.org"},
license: "MPL",
description: "performs a lookup on DBpedia (http://dbpedia.org)",
preview: function(previewBlock, term) {
previewBlock.innerHTML = "looking up " + term.text + " at DBpedia ... ";
var baseURI = "http://lookup.dbpedia.org/query.aspx?q=" + term.text;
//displayMessage(sparams.q);
jQuery.ajax({
type: "GET",
url: baseURI,
datatype: "string",
error: function(responseData) {
previewBlock.innerHTML = "<em>Error:" + responseData.responseText + "</em>";
},
success: function(responseData) {
previewBlock.innerHTML = responseData; }
});
},
execute: function(sterm) {
Utils.openUrlInBrowser("http://lookup.dbpedia.org/query.aspx?q=" + term.text);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment