Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created May 24, 2013 15:56
Show Gist options
  • Save vsavkin/5644487 to your computer and use it in GitHub Desktop.
Save vsavkin/5644487 to your computer and use it in GitHub Desktop.
function queryWikipedia(term) {
var url = "http://en.wikipedia.org/w/api.php";
var data = {action: 'opensearch', search: encodeURI(term)};
return $.getAsObservable(url, data, 'jsonp');
}
function updateResults(items){
var ul = $("#items");
ul.html(_.map(items, function(item){
return "<li>" + item + "</li>";
}).join(""));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment