-
-
Save mhausenblas/59915 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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