diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index d7080de..7821283 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -112,6 +112,31 @@ define_webjump("arch/packages", "https://www.archlinux.org/packages/?sort=&q=%s&limit=50", $alternative="https://packages.archlinux.org"); +/// Chickadee +// From http://conkeror.org/Webjumps +function chickadee_completer (input, cursor_position, conservative) { + var completions = []; + var content = yield send_http_request( + load_spec({uri: "http://api.call-cc.org/cdoc/ajax/prefix?q="+ + encodeURIComponent(input)})); + if (content.responseText) { + var parser = Cc["@mozilla.org/xmlextras/domparser;1"] + .createInstance(Ci.nsIDOMParser); + var doc = parser.parseFromString(content.responseText, "text/xml"); + var res = doc.getElementsByTagName("li"); + for (let i = 0, n = res.length; i < n; ++i) { + completions.push(res[i].textContent); + } + } + yield co_return(prefix_completer($completions = completions) + (input, cursor_position, conservative)); +} +define_webjump("chickadee", + "http://api.call-cc.org/cdoc?q=%s&query-name=Lookup", + $alternative = "http://api.call-cc.org/doc/", + $completer = chickadee_completer); +/// /Chickadee + // content_policy_bytype_table.object = oni_block_flash; cwd = make_file("/home/slash/downloads/"); hint_digits = "arstdhneio";