diff --git a/README.md b/README.md index 87520e1..c4b43e6 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Your request will be **rejected** if your instance: + Torrent results from popular torrent sites + Special queries (e.g.: 1 btc to usd , what does xyz mean etc.) + Tracking snippets from URLs are removed ++ Multiple color themes + Image results are converted to base64 to prevent clients from connecting to Google servers + Supports both POST and GET requests + Popular social media sites (YouTube, Instagram, Twitter) are replaced with privacy friendly front-ends @@ -51,4 +52,11 @@ Example API request: `.../api.php?q=gentoo&p=2&type=0`

The API also supports both POST and GET requests. # Donate -Monero (XMR): `41dGQr9EwZBfYBY3fibTtJZYfssfRuzJZDSVDeneoVcgckehK3BiLxAV4FvEVJiVqdiW996zvMxhFB8G8ot9nBFqQ84VkuC` +### Monero (XMR) +Address: `41dGQr9EwZBfYBY3fibTtJZYfssfRuzJZDSVDeneoVcgckehK3BiLxAV4FvEVJiVqdiW996zvMxhFB8G8ot9nBFqQ84VkuC` + +QR code: + +

+ +

\ No newline at end of file diff --git a/config.php b/config.php index 8edca5b..eb8cec0 100755 --- a/config.php +++ b/config.php @@ -28,7 +28,7 @@ // CURLOPT_PROXYTYPE => CURLPROXY_HTTP, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", - CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36", + CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36", CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_SSL_VERIFYHOST => false, diff --git a/engines/google/text.php b/engines/google/text.php index d5321b2..e9b009a 100644 --- a/engines/google/text.php +++ b/engines/google/text.php @@ -53,7 +53,7 @@ $url = "https://api.dictionaryapi.dev/api/v2/entries/en/$word_to_define"; break; case 3: - $url = "https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&explaintext&redirects=1&titles=$query_encoded"; + $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; } @@ -141,6 +141,8 @@ $source = $special["special_response"]["source"]; echo "

"; + if (array_key_exists("image", $special["special_response"])) + echo ""; echo $response; echo "$source"; echo "

"; diff --git a/engines/special/wikipedia.php b/engines/special/wikipedia.php index d17d753..714868d 100644 --- a/engines/special/wikipedia.php +++ b/engines/special/wikipedia.php @@ -12,12 +12,17 @@ $description = substr($first_page["extract"], 0, 250) . "..."; $source = "https://en.wikipedia.org/wiki/$query"; - return array( + $response = array( "special_response" => array( "response" => $description, "source" => $source ) ); + + if (array_key_exists("thumbnail", $first_page)) + $response["special_response"]["image"] = $first_page["thumbnail"]["source"]; + + return $response; } } ?> \ No newline at end of file diff --git a/static/css/styles.css b/static/css/styles.css index 8716cec..e4c6b28 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -191,6 +191,15 @@ a:hover, .text-result-wrapper h2:hover { font-size:14px; } +.special-result-container img { + display: flex; + max-width: 60%; + max-height: 200px; + padding-bottom:10px; + margin-left:auto; + margin-right:auto; +} + .next-page-button-wrapper { margin-top:-50px; margin-bottom:100px; @@ -200,8 +209,8 @@ a:hover, .text-result-wrapper h2:hover { border:none; background-color: inherit; color: var(--result-link-fg); - font-size: 20px; - margin-right: 6px; + font-size: 18px; + margin-right: 8px; } .next-page-button-wrapper #page { @@ -304,6 +313,10 @@ a:hover, .text-result-wrapper h2:hover { max-width: 80%; } + .special-result-container img { + max-width: 80%; + } + .misc-container { margin-bottom: 200px; width: 95%;