mirror of
https://github.com/gnh1201/caterpillar.git
synced 2024-11-26 07:21:46 +00:00
Update console.html
This commit is contained in:
parent
7810e85dec
commit
ff381b8e3e
12
console.html
12
console.html
|
@ -400,17 +400,25 @@
|
|||
}
|
||||
},
|
||||
search: function(...args) {
|
||||
set_default_env({
|
||||
"page": 1
|
||||
});
|
||||
|
||||
var term = this;
|
||||
var q = encodeURIComponent(args.join(' '));
|
||||
var url = "https://serp.catswords.net/api.php?q=" + q;
|
||||
|
||||
|
||||
if (env.page > 1) {
|
||||
url += "&p=" + env.page + "&t=0";
|
||||
}
|
||||
|
||||
$.get(url, function(data) {
|
||||
if ("error" in data) {
|
||||
term.echo(data.error.message);
|
||||
term.echo('');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var results = Object.values(data);
|
||||
if (results.length > 0) {
|
||||
results.forEach(function(x) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user