mirror of
https://github.com/hnhx/librex.git
synced 2025-04-29 14:09:27 -04:00
added libreddit option , fixed an issue regarding wiki text search
This commit is contained in:
parent
eb318f7315
commit
31c6bf2a8a
3 changed files with 14 additions and 5 deletions
|
@ -17,12 +17,14 @@
|
|||
Online invidious instances: https://docs.invidious.io/Invidious-Instances.md
|
||||
Online bibliogram instances: https://git.sr.ht/~cadence/bibliogram-docs/tree/master/docs/Instances.md
|
||||
Online nitter instances: https://github.com/zedeus/nitter/wiki/Instances
|
||||
Online libreddit instances: https://github.com/spikecodes/libreddit
|
||||
|
||||
Set as null or 0 if you don't want to replace results
|
||||
*/
|
||||
$config_replace_youtube_with_invidious = "https://yewtu.be";
|
||||
$config_replace_instagram_with_bibliogram = "https://bibliogram.pussthecat.org";
|
||||
$config_replace_twitter_with_nitter = "https://nitter.namazso.eu";
|
||||
$config_replace_reddit_with_libreddit = "https://libreddit.dothq.co";
|
||||
|
||||
/*
|
||||
To send requests trough a proxy uncomment CURLOPT_PROXY and CURLOPT_PROXYTYPE:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
return 0;
|
||||
}
|
||||
|
||||
function get_text_results($query, $page=0, $api=false)
|
||||
function get_text_results($query, $page=0)
|
||||
{
|
||||
require "config.php";
|
||||
require "misc/tools.php";
|
||||
|
@ -66,23 +66,28 @@
|
|||
curl_multi_exec($mh, $running);
|
||||
} while ($running);
|
||||
|
||||
if ($special_search != 0 && $api == false)
|
||||
if ($special_search != 0)
|
||||
{
|
||||
$special_result = null;
|
||||
|
||||
switch ($special_search)
|
||||
{
|
||||
case 1:
|
||||
require "engines/special/currency.php";
|
||||
array_push($results, currency_results($query, curl_multi_getcontent($special_ch)));
|
||||
$special_result = currency_results($query, curl_multi_getcontent($special_ch));
|
||||
break;
|
||||
case 2:
|
||||
require "engines/special/definition.php";
|
||||
array_push($results, definition_results($query, curl_multi_getcontent($special_ch)));
|
||||
$special_result = definition_results($query, curl_multi_getcontent($special_ch));
|
||||
break;
|
||||
case 3:
|
||||
require "engines/special/wikipedia.php";
|
||||
array_push($results, wikipedia_results($query, curl_multi_getcontent($special_ch)));
|
||||
$special_result = wikipedia_results($query, curl_multi_getcontent($special_ch));
|
||||
break;
|
||||
}
|
||||
|
||||
if ($special_result != null)
|
||||
array_push($results, $special_result);
|
||||
}
|
||||
|
||||
$xpath = get_xpath(curl_multi_getcontent($google_ch));
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
}
|
||||
else if ($config_replace_twitter_with_nitter != null && strpos($url, "twitter.com"))
|
||||
$url = $config_replace_twitter_with_nitter . explode("twitter.com", $url)[1];
|
||||
else if ($config_replace_reddit_with_libreddit != null && strpos($url, "reddit.com"))
|
||||
$url = $config_replace_reddit_with_libreddit . explode("reddit.com", $url)[1];
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue