diff --git a/assets/php/index.php b/assets/php/index.php index 85799ec..fa4ff29 100644 --- a/assets/php/index.php +++ b/assets/php/index.php @@ -490,8 +490,14 @@ function relay_invoke_method($params) { } function relay_web_search($params) { + $page = $params['page']; + $search_params = array( + "q" => $params['keyword'], + "p" => ($page > 0 ? $page - 1 : 0), + "t" => "0" // text only + ); $result = relay_fetch_url(array( - "url" => "https://serp.catswords.net/api.php?" . http_build_query($params) + "url" => "https://serp.catswords.net/api.php?" . http_build_query($search_params) )); if ($result['success']) { return array( @@ -632,4 +638,4 @@ if ($context['jsonrpc'] == "2.0") { "status" => 403, "message" => "Unsupported format" ), ""); -} +} \ No newline at end of file diff --git a/console.html b/console.html index 644659d..5470652 100644 --- a/console.html +++ b/console.html @@ -471,7 +471,7 @@ }, prev: function() { if (env.method == "relay_web_search") { - var num = (env.page > 1 ? parseInt(env.page) - 1 : 1); + var num = (env.page > 1 ? env.page - 1 : 1); this.exec("set page " + num); this.exec("do"); }