wikipedia frontend locale is now set correctly, updated readme

This commit is contained in:
hnhx 2022-12-14 09:58:03 +01:00
parent ac7b690b32
commit f883df2d07
4 changed files with 30 additions and 11 deletions

View File

@ -1,8 +1,8 @@
<h1 align="center">LibreX</h1> <h1 align="center">LibreX</h1>
<p float="left"> <p float="left">
<img src="https://user-images.githubusercontent.com/49120638/188424011-f75eb4f6-72ad-4f9b-9344-d169076426e8.png" width="400"> <img src="https://user-images.githubusercontent.com/49120638/207549667-c731a4f2-b9b0-4385-96be-9c17a8bb2984.png" width="400">
<img src="https://user-images.githubusercontent.com/49120638/188424232-a60bdf68-09c1-47f1-affc-fa9deab38277.png" width="400"> <img src="https://user-images.githubusercontent.com/49120638/207550159-4fa639a5-24e6-42e0-9e58-f04e5d18e391.png" width="400">
</p> </p>
<p align="center">A privacy respecting free as in freedom meta search engine</p> <p align="center">A privacy respecting free as in freedom meta search engine</p>
@ -26,6 +26,14 @@
| [librex.kitscomputer.tk](https://librex.kitscomputer.tk/) | ❌ | ❌ | 🇺🇸 US | | [librex.kitscomputer.tk](https://librex.kitscomputer.tk/) | ❌ | ❌ | 🇺🇸 US |
<br> <br>
### Thanks rms
Huge thanks to Richard Stallman for using LibreX and featuring it on his [website](https://stallman.org/stallman-computing.html)!
> However, the Librex proxies have worked around that problem. They enable me to access Google Search indirectly, and they work correctly through Tor with LibreJS enabled.
<br>
### About LibreX ### About LibreX
LibreX gives you results from Google, Brave, Qwant, Ahmia and popular torrent sites without spying on you. LibreX gives you results from Google, Brave, Qwant, Ahmia and popular torrent sites without spying on you.
@ -33,6 +41,7 @@ LibreX gives you results from Google, Brave, Qwant, Ahmia and popular torrent si
<br> <br>
If you would like to learn more about LibreX check out the [Wiki](https://github.com/hnhx/librex/wiki). If you would like to learn more about LibreX check out the [Wiki](https://github.com/hnhx/librex/wiki).
<br> <br>
<br>
### Mirror ### Mirror
@ -42,8 +51,8 @@ git clone https://git.beparanoid.de/librex
``` ```
### LibreX compared to other metasearch engines ### LibreX compared to other metasearch engines
| Metasearch engine | Works without JS | Privacy frontend redirect | Torrent results | API | | Name | Works without JS | Privacy frontend redirect | Torrent results | API | No 3rd party libs used |
|-|-|-|-|-| |-|-|-|-|-|-|
| LibreX | ✅ | ✅ | ✅ | ✅ | | LibreX | ✅ | ✅ | ✅ | ✅ | ✅ |
| SearXNG | ❓ Not user friendly | ❓ Only host can set it | ✅ | ✅ | | SearXNG | ❓ Not user friendly | ❓ Only host can set it | ✅ | ✅ | ❌ |
| Whoogle | ✅ | ❓ Only host can set it | ❌ | ❌ | | Whoogle | ✅ | ❓ Only host can set it | ❌ | ❌ | ❌ |

View File

@ -11,7 +11,7 @@
{ {
$description = substr($first_page["extract"], 0, 250) . "..."; $description = substr($first_page["extract"], 0, 250) . "...";
$source = check_for_privacy_frontend("https://wikipedia.org/wiki/$query"); $source = check_for_privacy_frontend("https://en.wikipedia.org/wiki/$query");
$response = array( $response = array(
"special_response" => array( "special_response" => array(
"response" => htmlspecialchars($description), "response" => htmlspecialchars($description),

View File

@ -28,7 +28,19 @@
if (empty(trim($frontend))) if (empty(trim($frontend)))
return $url; return $url;
if (strpos($url, "wikipedia.org") !== false)
{
$wiki_split = explode(".", $url);
if (count($wiki_split) > 1)
{
$lang = explode("://", $wiki_split[0])[1];
$url = $frontend . explode($original, $url)[1] . "?lang=" . $lang;
}
}
else
{
$url = $frontend . explode($original, $url)[1]; $url = $frontend . explode($original, $url)[1];
}
return $url; return $url;
} }

File diff suppressed because one or more lines are too long