Skip to content

Instantly share code, notes, and snippets.

@mhausenblas mhausenblas/x
Created Feb 7, 2009

Embed
What would you like to do?
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
You can’t perform that action at this time.