Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

still working...

  • Loading branch information...
commit c20a99a6e9e6f3df6b77a4858b189a7c6cd6ac01 1 parent 1cca6d3
@rpicard rpicard authored
Showing with 12 additions and 7 deletions.
  1. +12 −7 js/background.js
View
19 js/background.js
@@ -1,21 +1,26 @@
window.addEventListener('load', function() {
- function getQuery() {
-
+ $.getJSON('http://en.wikipedia.org/w/api.php?callback=?',
+ {
+ action: "query",
+ list: "random",
+ rnnamespace: "0",
+ rnlimit: "1",
+ format: "json"
+ },
+ function(data) {
+
var title = "testing";
$("#searchBox").val(title);
if (opera.contexts.speeddial) {
var url = "http://duckduckgo.com/?q=" + encodeURIComponent(title);
- var sd = opera.contexts.speeddial;
+ var sd = opera.contexts.speeddial;
sd.url = url;
}
-
- return 0;
- }
- getQuery();
+ });
}, false);
Please sign in to comment.
Something went wrong with that request. Please try again.