diff --git a/README.md b/README.md index 5c6f7c0..d199d03 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ | [librex.extravi.dev](https://librex.extravi.dev/) | [β ](http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion/) | [β ](http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p/) | π©πͺ DE | | [lx.vern.cc](https://lx.vern.cc/) | [β ](http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/) | [β ](http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/) | πΊπΈ US | | [search.davidovski.xyz](https://search.davidovski.xyz/) | β | β | π¬π§ UK | -| [librex.kitscomputer.tk](https://librex.kitscomputer.tk/) | β | β | πΊπΈ US | | [search.funami.tech](https://search.funami.tech/) | β | β | π°π· KR | | [librex.catalyst.sx](https://librex.catalyst.sx/) | β | β | πΊπΈ US | | [search.madreyk.xyz](https://search.madreyk.xyz/) | β | β | π©πͺ DE | diff --git a/engines/google/text.php b/engines/google/text.php index 5fb33a7..4f1a7e8 100644 --- a/engines/google/text.php +++ b/engines/google/text.php @@ -21,17 +21,25 @@ { if (strpos($query_lower, "ip")) { - return 4; + return 3; } else if (strpos($query_lower, "user agent") || strpos($query_lower, "ua")) { - return 5; + return 4; } } + else if (strpos($query_lower, "weather") !== false) + { + return 5; + } + else if (strpos($query_lower, "tor") !== false) + { + return 6; + } else if (3 > count(explode(" ", $query))) // wikipedia { - return 3; - } + return 7; + } return 0; } @@ -67,7 +75,13 @@ $word_to_define = $reversed_split_q[1]; $url = "https://api.dictionaryapi.dev/api/v2/entries/en/$word_to_define"; break; - case 3: + case 5: + $url = "https://wttr.in/@" . $_SERVER["REMOTE_ADDR"] . "?format=j1"; + break; + case 6: + $url = "https://check.torproject.org/torbulkexitlist"; + break; + case 7: $url = "https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts%7Cpageimages&exintro&explaintext&redirects=1&pithumbsize=500&titles=$query_encoded"; break; } @@ -98,18 +112,27 @@ require "engines/special/definition.php"; $special_result = definition_results($query, curl_multi_getcontent($special_ch)); break; + case 3: - require "engines/special/wikipedia.php"; - $special_result = wikipedia_results($query, curl_multi_getcontent($special_ch)); - break; - case 4: require "engines/special/ip.php"; $special_result = ip_result(); break; - case 5: + case 4: require "engines/special/user_agent.php"; $special_result = user_agent_result(); break; + case 5: + require "engines/special/weather.php"; + $special_result = weather_results(curl_multi_getcontent($special_ch)); + break; + case 6: + require "engines/special/tor.php"; + $special_result = tor_result(curl_multi_getcontent($special_ch)); + break; + case 7: + require "engines/special/wikipedia.php"; + $special_result = wikipedia_results($query, curl_multi_getcontent($special_ch)); + break; } if ($special_result != null) @@ -175,7 +198,7 @@ array_shift($results); } - + echo "