Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
getWikipediaData(query){
var dbpediaHeaders = new Headers();
//add json response type for dbpedia query
dbpediaHeaders.append("accept", "application/json");
//if the query has multiple words separated by the comma, take the first word, otherwise just use the query
query=query.indexOf(",")>0?query.split(',')[0]:query;
//if we know the query is a country, only look for countries