Skip to content

Commit

Permalink
Update console.html
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 committed Nov 7, 2024
1 parent 7810e85 commit ff381b8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions console.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,17 +400,25 @@ <h1>Caterpillar Proxy Console</h1>
}
},
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) {
Expand Down

0 comments on commit ff381b8

Please sign in to comment.