Archived
1
Fork 0
forked from Korbs/4get

Remove all trace of the name "4Get" and "lolcat.ca" and remove swear words

This commit is contained in:
Korbs 2024-06-07 20:47:08 -04:00
parent b492ef2329
commit 658b3cbac5
58 changed files with 648 additions and 1457 deletions

8
CHANGESMADE.md Normal file
View file

@ -0,0 +1,8 @@
This is a fork of an existing project.
In terms of how functions work, nothing was changed.
The following changes were made:
- Remove all swear words, very rude
- New design
- Removed project name and replaced with "NarviSearch"

View file

@ -1,5 +1,5 @@
FROM alpine:latest
WORKDIR /var/www/html/4get
WORKDIR /var/www/html/narvisearch
RUN apk update && apk upgrade
RUN apk add php apache2-ssl php83-fileinfo php83-openssl php83-iconv php83-common php83-dom php83-sodium php83-curl curl php83-pecl-apcu php83-apache2 imagemagick php83-pecl-imagick php-mbstring imagemagick-webp imagemagick-jpeg
@ -7,8 +7,6 @@ RUN apk add php apache2-ssl php83-fileinfo php83-openssl php83-iconv php83-commo
COPY ./docker/apache/ /etc/apache2/
COPY . .
RUN chmod 777 /var/www/html/4get/icons
EXPOSE 80
EXPOSE 443

View file

@ -1,22 +1,11 @@
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W2OZK5H)
# NarviSearch search
**NarviSearch** is a proxy search engine that doesn't suck.
# 4get search
**4get** is a proxy search engine that doesn't suck.
## About 4get
https://4get.ca/about
## About NarviSearch
https://search.sudovanilla.org/about
## Try it out
https://4get.ca
## Totally unbiased comparison between alternatives
| | 4get | searx(ng) | librex | araa |
|----------------------------|-------------------------|-----------|-------------|-----------|
| RAM usage | 200-400mb~ | 2GB~ | 200-400mb~ | 2GB~ |
| Does it suck | no (debunked by snopes) | yes | yes | a little |
| Does it work | ye | sometimes | no | sometimes |
| Did the dev commit suicide | not until my 30s | no | allegedly | no |
https://search.sudovanilla.org/
## Features
1. Rotating proxies on a per-scraper basis
@ -24,9 +13,7 @@ https://4get.ca
3. Bot protection that *actually* filters out the bots (when configured)
4. Interface doesn't require javascript
5. Favicon fetcher with caching support & image proxy
6. Bunch of other shit
tl;dr the best way to actually browse for shit.
6. Other neat thing
# Supported websites
@ -45,9 +32,3 @@ tl;dr the best way to actually browse for shit.
| Marginalia | | | | | |
| wiby | | | | | |
| Curlie | | | | | |
# Installation
Refer to the <a href="https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/">documentation index</a>. I recommend following the <a href="https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/apache2.md">apache2 guide</a>.
## Contact
Shit breaks all the time but I repair it all the time too... Email me here: <b>will (at) lolcat.ca</b> or create an issue.

View file

@ -11,7 +11,7 @@ $bot_requests = apcu_fetch("captcha_gen");
echo json_encode(
[
"status" => "ok",
"service" => "4get",
"service" => "narvisearch",
"server" => [
"name" => config::SERVER_NAME,
"description" => config::SERVER_LONG_DESCRIPTION,

78
api.txt
View file

@ -1,11 +1,10 @@
__ __ __
/ // / ____ ____ / /_
/ // /_/ __ `/ _ \/ __/
/__ __/ /_/ / __/ /_
/_/ \__, /\___/\__/
/____/
_ _ _ ____ _
| \ | | __ _ _ __ __ __ (_) / ___| ___ __ _ _ __ ___ | |__
| \| | / _` | | '__| \ \ / / | | \___ \ / _ \ / _` | | '__| / __| | '_ \
| |\ | | (_| | | | \ V / | | ___) | | __/ | (_| | | | | (__ | | | |
|_| \_| \__,_| |_| \_/ |_| |____/ \___| \__,_| |_| \___| |_| |_|
+ Welcome to the 4get API documentation +
+ Welcome to the NarviSearch API documentation +
+ Terms of use
Do NOT misuse the API. Misuses can include... ::
@ -26,15 +25,12 @@
If you wish to engage in the activities listed under "misuses", feel
free to download the source code of the project and running 4get
free to download the source code of the project and running NarviSearch
under your own terms. Please respect the terms of use listed here so
that this website may be available to all in the far future.
P.s fuck whoever botted my site for months on end, choke on my dick
lol!!!!
Get your instance running here ::
https://git.lolcat.ca/lolcat/4get
https://ark.sudovanilla.org/Korbs/NarviSearch
Thanks!
@ -86,7 +82,7 @@
array position on the serber's memory. The second part is an
encryption key used to decode the data at that position. This way,
it is impossible to supply invalid pagination data and it is
impossible for a 4get operator to peek at the private data of the
impossible for a NarviSearch operator to peek at the private data of the
user after a request has been made.
The tokens will expire as soon as they are used or after a 15
@ -99,7 +95,7 @@
+ API Parameters
To construct a valid request, you can use the 4get web interface
To construct a valid request, you can use the NarviSearch web interface
to craft a valid request, and replace "/web" with "/api/v1/web".
@ -119,8 +115,8 @@
/_____/_/ /_/\__,_/ .___/\____/_/_/ /_/\__/____/
/_/
+ /ami4get
Tells you basic information about the 4get instance. CORS requests
+ /amins
Tells you basic information about the NarviSearch instance. CORS requests
are allowed on this endpoint.
@ -174,7 +170,7 @@
value: "Higurashi is a great show!"
1:
type: "quote"
value: "Source: my ass"
value: "Source: source"
Each "description" node contains an array index named "type".
@ -194,30 +190,6 @@
Each individual node prepended with a "+" should be prepended by
a newline when constructing the rendered description object.
There are some nodes that differ from the type-value format.
Please parse them accordingly ::
+ link
type: "link"
url: "https://lolcat.ca"
value: "Visit my website!"
+ image
type: "image"
url: "https://lolcat.ca/static/pixels.png"
+ audio
type: "audio"
url: "https://lolcat.ca/static/whatever.mp3"
The array index named "table" is an associative array. You can
loop over the data using this PHP code, for example ::
foreach($table as $website_name => $url){ // ...
The rest of the JSON is pretty self explanatory.
@ -231,11 +203,11 @@
title: "My awesome Higurashi image"
source:
0:
url: "https://lolcat.ca/static/profile_pix.png"
url: "https://example.com/static/profile_pix.png"
width: 400
height: 400
1:
url: "https://lolcat.ca/static/pixels.png"
url: "https://example.com/static/pixels.png"
width: 640
height: 640
2:
@ -273,11 +245,11 @@
When the endpoint is something else than "linear", you MUST use
the specified endpoint. Otherwise, you are free to handle that
json+m3u8 crap yourself. If the endpoint is equal to "linear", the
json+m3u8 stuff yourself. If the endpoint is equal to "linear", the
URL should return a valid HTTP audio stream. To access the endpoint,
you must add the following prefix in your request, like so:
https://4get.ca/audio/<endpoint>?s=<url>
https://search.sudovanilla.org/audio/<endpoint>?s=<url>
+ /favicon
@ -287,7 +259,7 @@
Example ::
/favicon?s=https://lolcat.ca
/favicon?s=https://example.com
If we had to revert to using Google's favicon cache, it will throw
@ -329,9 +301,8 @@
Content" parts, due to technical limitations that comes with
converting m3u8 playlists to seekable audio files. If you use this
endpoint, you must support these 206 codes and also handle the
initial 302 HTTP redirect. I used this method as I didn't want to
store information about your request needlessly. This method also
allows noJS users to access the files.
initial 302 HTTP redirect. This method also allows noJS users
to access the files.
The parameter is "s" for the SoundCloud JSON m3u8 abomination. It
does not support "normal" SoundCloud URLs at this time.
@ -339,12 +310,11 @@
+ /audio/spotify
Get a proxied Spotify audio file. Accepts a track ID for the "s"
parameter. Will only allow you to fetch the 30 second preview since
I don't feel like fucking with cookies and accounts every fucking
living moment of my life. You must handle the initial 302 redirect
to the /audio/linear endpoint.
parameter. Will only allow you to fetch the 30 second preview.
You must handle the initial 302 redirect to the /audio/linear
endpoint.
+ Appendix
If you have any questions or need clarifications, please send an
email my way to will at lolcat.ca
email my way to korbs@sudovanilla.org.

View file

@ -7,8 +7,8 @@ class spotify{
public function __construct(){
include "../lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "../lib/heckhtml.php";
$this->heckhtml = new heckhtml();
if(
!isset($_GET["s"]) ||
@ -39,10 +39,10 @@ class spotify{
$this->do404("Failed to fetch embed data");
}
$this->fuckhtml->load($embed);
$this->heckhtml->load($embed);
$json =
$this->fuckhtml
$this->heckhtml
->getElementById(
"__NEXT_DATA__",
"script"

View file

@ -11,7 +11,7 @@ if(
http_response_code(401);
header("Content-Type: text/plain");
echo "Fuck my feathered cloaca";
echo "Heck my feathered cloaca";
die();
}

View file

@ -1,14 +1,14 @@
<?php
class config{
// Welcome to the 4get configuration file
// Welcome to the NarviSearch configuration file
// When updating your instance, please make sure this file isn't missing
// any parameters.
// 4get version. Please keep this updated
// NarviSearch version. Please keep this updated
const VERSION = 8;
// Will be shown pretty much everywhere.
const SERVER_NAME = "4get";
const SERVER_NAME = "NarviSearch";
// Will be shown in <meta> tag on home page
const SERVER_SHORT_DESCRIPTION = "They live in our walls!";
@ -71,37 +71,14 @@ class config{
// List of domains that point to your servers. Include your tor/i2p
// addresses here! Must be a valid URL. Won't affect links placed on
// the homepage.
const ALT_ADDRESSES = [
//"https://4get.alt-tld",
//"http://4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion"
];
const ALT_ADDRESSES = [];
// Known 4get instances. MUST use the https protocol if your instance uses
// Known NarviSearch instances. MUST use the https protocol if your instance uses
// it. Is used to generate a distributed list of instances.
// To appear in the list of an instance, contact the host and if everyone added
// eachother your serber should appear everywhere.
const INSTANCES = [
"https://4get.ca",
"https://4get.zzls.xyz",
"https://4getus.zzls.xyz",
"https://4get.silly.computer",
"https://4get.konakona.moe",
"https://4get.lvkaszus.pl",
"https://4g.ggtyler.dev",
"https://4get.perennialte.ch",
"https://4get.sijh.net",
"https://4get.hbubli.cc",
"https://4get.plunked.party",
"https://4get.seitan-ayoub.lol",
"https://4get.etenie.pl",
"https://4get.lunar.icu",
"https://4get.dcs0.hu",
"https://4get.kizuki.lol",
"https://4get.psily.garden",
"https://search.milivojevic.in.rs",
"https://4get.snine.nl",
"https://4get.datura.network",
"https://4get.neco.lol"
"https://search.sudovanilla.org"
];
// Default user agent to use for scraper requests. Sometimes ignored to get specific webpages

View file

@ -1,20 +1,15 @@
# example docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
image: docker.io/library/4get
restart: unless-stopped
environment:
- FOURGET_VERSION=6
- FOURGET_SERVER_NAME=4get.ca
- FOURGET_VERSION=1
- FOURGET_SERVER_NAME=search.sudovanilla.org
ports:
- "80:80"
- "443:443"
volumes:
- /etc/letsencrypt/live/domain.tld:/etc/4get/certs
# mount custom banners and captcha
- ./banners:/var/www/html/4get/banner
- ./captcha:/var/www/html/4get/data/captcha
- ./banners:/var/www/html/narvisearch/banner
- ./captcha:/var/www/html/narvisearch/data/captcha

View file

@ -4,13 +4,13 @@ ServerRoot /var/www
ServerSignature On
ServerName localhost
DocumentRoot "/var/www/html/4get"
DocumentRoot "/var/www/html/narvisearch"
LogLevel warn
CustomLog /dev/null common
ErrorLog /dev/null
<Directory "/var/www/html/4get">
<Directory "/var/www/html/narvisearch">
RewriteEngine On
RewriteCond %{THE_REQUEST} ^\w+\ /(.*)\.php(\?.*)?\ HTTP/
RewriteRule ^ http://%{HTTP_HOST}/%1 [R=301]
@ -22,7 +22,7 @@ ErrorLog /dev/null
</Directory>
# deny access to private resources
<Directory "/var/www/html/4get/data">
<Directory "/var/www/html/narvisearch/data">
Require all denied
<Files "*">
Require all denied

View file

@ -3,7 +3,7 @@ ServerRoot /var/www
ServerSignature On
ServerName localhost
DocumentRoot "/var/www/html/4get"
DocumentRoot "/var/www/html/narvisearch"
LogLevel warn
CustomLog /dev/null common
@ -11,11 +11,11 @@ ErrorLog /dev/null
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/4get/certs/fullchain.pem
SSLCertificateKeyFile /etc/4get/certs/privkey.pem
SSLCertificateFile /etc/narvisearch/certs/fullchain.pem
SSLCertificateKeyFile /etc/narvisearch/certs/privkey.pem
</VirtualHost>
<Directory "/var/www/html/4get">
<Directory "/var/www/html/narvisearch">
RewriteEngine On
RewriteCond %{THE_REQUEST} ^\w+\ /(.*)\.php(\?.*)?\ HTTP/
RewriteRule ^ http://%{HTTP_HOST}/%1 [R=301]
@ -27,7 +27,7 @@ ErrorLog /dev/null
</Directory>
# deny access to private resources
<Directory "/var/www/html/4get/data">
<Directory "/var/www/html/narvisearch/data">
Require all denied
<Files "*">
Require all denied

View file

@ -20,6 +20,6 @@ fi
php ./docker/gen_config.php
echo "4get is running"
echo "NarviSearch is running"
exec httpd -DFOREGROUND

View file

@ -1,6 +1,6 @@
<?php
include "/var/www/html/4get/data/config.php";
include "/var/www/html/narvisearch/data/config.php";
$refl = new ReflectionClass('config');
$from_config = ($refl->getConstants());
@ -40,14 +40,14 @@ function type_to_string($n) {
function detect_captcha_dirs() {
$captcha_dir = "/var/www/html/4get/data/captcha/";
$captcha_dir = "/var/www/html/narvisearch/data/captcha/";
$categories = (array_map(function ($n) {
return explode("/", $n)[7];
}, glob($captcha_dir . "*")));
$result = array_map(function($category) {
return [$category, count(glob("/var/www/html/4get/data/captcha/" . $category . "/*" ))];
return [$category, count(glob("/var/www/html/narvisearch/data/captcha/" . $category . "/*" ))];
}, $categories);
return $result;

View file

@ -1,228 +0,0 @@
# Install guide for Apache2 webserver
Welcome to the new and revamped 4get install manual for apache2. Even if you already have services running on an existing installation of apache2, you should still be able to adapt this guide to your needs.
For starters, login as `root`.
Then, install the following dependencies:
```sh
apt update
apt upgrade
apt install php-mbstring apache2 certbot php-imagick imagemagick php-curl curl php-apcu git libapache2-mod-php
```
Enable the required modules:
```sh
a2enmod ssl
a2enmod rewrite
```
And enable these optional ones, which might be useful to you later on. The `proxy` module is useful for setting up reverse proxies to services like gitea, and `headers` is useful to tweak global header values:
```sh
a2enmod proxy
a2enmod headers
```
Now, restart apache2:
```sh
service apache2 restart
```
Just for good measure, please check if your webserver is running. Access it through HTTP, not HTTPS. You should see the apache2 default landing page.
## 000-default.conf
Now, edit the following file: `/etc/apache2/sites-available/000-default.conf`, remove everything and carefully add each rule specified here, while making sure to replace my domains with your own:
1. The `VirtualHost` here instructs apache2 to redirect all **HTTP** traffic that specify an unknown `Host` header be redirected to a specific domain of your choice. Configuring this is not required but highly recommended.
```xml
<VirtualHost *:80>
# no domain = go to 4get.ca
RedirectMatch 301 ^(.*)$ https://4get.ca$1
</VirtualHost>
```
2. This instruction tells apache2 to redirect all HTTP traffic on `Host` lolcat.ca to the HTTPS version of the site. You should add a rule like this for all of your services explicitly.
```xml
<VirtualHost *:80>
ServerName lolcat.ca
RedirectMatch 301 ^(.*)$ https://lolcat.ca$1
</VirtualHost>
```
3. Subdomains won't be matched by the above rule, so I recommend you also add them to be more explicit:
```xml
<VirtualHost *:80>
ServerName www.lolcat.ca
RedirectMatch 301 ^(.*)$ https://lolcat.ca$1
</VirtualHost>
```
... Etc, for every service you own.
4. And finally, append this configuration if you wish to host a tor or i2p access point. This configuration should not be binded to SSL(443) as Let's Encrypt does not let you create certificates for onion sites:
```xml
<VirtualHost *:80>
# tor site
ServerName 4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion
# compress
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/css
DocumentRoot /var/www/4get
Options +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
# deny access to private resources
<Directory /var/www/4get/data/>
Order Deny,allow
Deny from all
</Directory>
</VirtualHost>
```
To make the above snippet work, please refer to our <a href="https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/tor.md">tor site guide</a>.
## default-ssl.conf
Now, edit the file `/etc/apache2/sites-available/default-ssl.conf`, remove everything and, again, add each rule while modifying the relevant fields:
This ruleset will redirect all clients that specify an unknown `Host` to the domain of our choice. I recommend you uncomment the `ErrorLog` directive while setting things up in case a problem occurs with PHP. Don't worry about the invalid SSL paths, we will generate our certificates later; Just make sure you specify the right domains in there:
```xml
<VirtualHost *:443>
RedirectMatch 301 ^(.*)$ https://4get.ca$1
ServerAdmin will@lolcat.ca
#ErrorLog ${APACHE_LOG_DIR}/error.log
SSLEngine on
<FilesMatch "\.(?:cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/css
SSLCertificateFile /etc/letsencrypt/live/4get.ca/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/4get.ca/privkey.pem
</VirtualHost>
```
This ruleset tells apache2 where 4get is located (`/var/www/4get`), ensures that `4get.ca/settings` resolves to `4get.ca/settings.php` internally and that we deny access to `/data/*`, which may contain files you might want to keep private.
```xml
<VirtualHost *:443>
ServerName 4get.ca
DocumentRoot /var/www/4get
Options +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
# deny access to private resources
<Directory /var/www/4get/data/>
Order Deny,allow
Deny from all
</Directory>
</VirtualHost>
```
Don't forget to specify your other services here! Here's an example of a ruleset I use for `lolcat.ca`:
```xml
<VirtualHost *:443>
ServerName lolcat.ca
DocumentRoot /var/www/lolcat
Options +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
</VirtualHost>
```
... Alongside with it's redirect rules.
```xml
<VirtualHost *:443>
ServerName www.lolcat.ca
RedirectMatch 301 ^(.*)$ https://lolcat.ca$1
</VirtualHost>
```
## security.conf
If you enabled the `headers` module, you can head over to `/etc/apache2/conf-enabled/security.conf` and edit:
```sh
ServerTokens Prod # instead off Full
```
and
```sh
ServerSignature Off #instead of On
```
This will ensure that the `Server` header apache2 returns is minimal and doesn't leak information like your host system's OS or apache2 version.
You can also uncomment `Header set X-Content-Type-Options: "nosniff"` and `Header set Content-Security-Policy "frame-ancestors 'self';"` respectively.
## charset.conf
Head over to `/etc/apache2/conf-enabled/charset.conf` and uncomment `AddDefaultCharset UTF-8`.
## other-vhost-access-log.conf
Since none of our configuration files contains any `CustomLog` directives, all we need to do to disable logging entirely is comment out the `CustomLog` directive located in `/etc/apache2/conf-enabled/other-vhost-access-log.conf`. Only error logs will remain if you configured them.
## Symlink everything
Now comes the most important part of the setup. Run
```sh
ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/default-ssl.conf
```
Otherwise apache2 will ignore our SSL configuration. Handy, huh?
# Setup SSL
Great, now we've configured the webserver, but we still don't have our security certificate. Let's generate one!
First, stop `apache2`.
```sh
service apache2 stop
```
Now, run `certbot`, and specify all of your domains by prepending `-d` every time. Make sure the first domain you specify is your main domain, and the same domain you specified in the configuration above! We use ECDSA encryption here as it's better than RSA.
```sh
certbot certonly --standalone --key-type ecdsa -d 4get.ca -d www.4get.ca -d lolcat.ca -d www.lolcat.ca
```
Certbot should ask you a few questions, just play along. At the end of the setup, certbot should tell you about the location of the certificates. Double check to make sure they correspond to the paths we specified in `default-ssl.conf`. Your certificates should now update every 2-3 months automatically.
After this is complete, create a directory in `/var/www/4get`.
Now, start `apache2`.
```sh
service apache2 start
```
Congratulations! You now have a... 404 error on your webserver, if everything went well. Now's the time to make sure all of our redirect rules work!
# Import the fun junk
Run these commands:
```
cd /var/www/4get
git clone https://git.lolcat.ca/lolcat/4get
chmod 777 -R icons/
```
... And try accessing your webserver. You should now have a working 4get instance!
Please make sure to check out how to further <a href="https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/configure.md">configure 4get</a> to your liking!

View file

@ -1,58 +0,0 @@
# Install guide for Caddy webserver
1. Install dependencies:
`sudo apt install caddy php8.2-dom php8.2-imagick imagemagick php8.2-curl curl php8.2-apcu git`
2. Clone this repository where you want to host this from:
`cd /var/www && sudo git clone https://git.konakona.moe/diowo/4get`
3. Set permission on the `icons` directory inside `4get`
`cd /var/www/4get/ && sudo chmod 777 -R icons/`
4. Add an entry for 4get on your Caddyfile at `/etc/caddy/Caddyfile`
```sh
4get.konakona.moe {
root * /var/www/4get
file_server
encode gzip
php_fastcgi unix//var/run/php/php8.2-fpm.sock {
index index.php
}
redir /{path}.php{query} 301
try_files {path} {path}.php
}
```
Caddy deals with SSL certificates automatically so you don't have to mess with anything. Also if needed, a sample of my Caddyfile can be found [here](https://git.konakona.moe/diowo/misc/src/branch/master/etc/caddy/Caddyfile).
5. Restart Caddy
`sudo systemctl restart caddy`
# Encryption setup
I'm schizoid (as you should) so I'm gonna setup 4096bit key encryption. To complete this step, you need a domain or subdomain in your possession. Make sure that the DNS shit for your domain has propagated properly before continuing, because certbot is a piece of shit that will error out the ass once you reach 5 attempts under an hour.
## Encryption setup on Apache
```sh
certbot --apache --rsa-key-size 4096 -d www.yourdomain.com -d yourdomain.com
```
When it asks to choose a vhost, choose the option with "HTTPS" listed. Don't setup HTTPS for tor, we don't need it (it doesn't even work anyways with let's encrypt)
Edit `000-default-le-ssl.conf`
Add this at the end:
```xml
<Directory /var/www/html/4get>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.*) $1.php [L]
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
```

View file

@ -1,68 +0,0 @@
# 4get configuation options
Welcome! This guide assumes that you have a working 4get instance. This will help you configure your instance to the best it can be!
# Files location
1. The main configuration file is located at `data/config.php`
2. The proxies are located in `data/proxies/*.txt`
3. The captcha imagesets are located in `data/captcha/your_image_set/*.png`
4. The captcha font is located in `data/fonts/captcha.ttf`
# Cloudflare bypass
**Note: this only allows you to bypass the browser integrity checks. Captchas & javascript challenges will not be bypassed.**
Configuring this lets you fetch images sitting behind Cloudflare and allows you to scrape the **Yep** search engine. Following these instructions might make your package manager unhappy.
First, follow these instructions. Only install the Firefox modules:
https://github.com/lwthiker/curl-impersonate/blob/main/INSTALL.md#native-build
Once you did this, you should be able to run the following inside your terminal:
```sh
$ curl_ff117 --version
curl 8.1.1 (x86_64-pc-linux-gnu) libcurl/8.1.1 NSS/3.92 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.3 nghttp2/1.56.0
Release-Date: 2023-05-23
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe UnixSockets zstd
```
Now, after compiling, you should have a `libcurl-impersonate-ff.so` sitting somewhere. Mine (on my debian install) is located at `/usr/local/lib/libcurl-impersonate-ff.so`.
Find the `libcurl.so.4` file used by your current installation of curl. For me, this file is located at `/usr/lib/x86_64-linux-gnu/libcurl.so.4`
Now comes the sketchy part: replace `libcurl.so.4` with `libcurl-impersonate-ff.so`. You can do this in the following way:
```sh
sudo rm /usr/lib/x86_64-linux-gnu/libcurl.so.4
sudo cp /usr/local/lib/libcurl-impersonate-ff.so /usr/lib/x86_64-linux-gnu/libcurl.so.4
```
Make sure to restart your webserver and/or PHP daemon, otherwise it will keep using the old library. You should now be able to bypass Cloudflare's shitty checks!!
# Robots.txt
Make sure you configure this right to optimize your search engine presence! Head over to `/robots.txt` and change the 4get.ca domain to your own domain.
# Server listing
To be listed on https://4get.ca/instances , you must contact *any* of the people in the server list and ask them to add you to their list of instances in their configuration. The instance list is distributed, and I don't have control over it.
If you see spammy entries in your instances list, simply remove the instance from your list that pushes the offending entries.
# Proxies
4get supports rotating proxies for scrapers! Configuring one is really easy.
1. Head over to the **proxies** folder. Give it any name you want, like `myproxy`, but make sure it has the `txt` extension.
2. Add your proxies to the file. Examples:
```conf
# format -> <protocol>:<address>:<port>:<username>:<password>
# protocol list:
# raw_ip, http, https, socks4, socks5, socks4a, socks5_hostname
socks5:1.1.1.1:juicy:cloaca00
http:1.3.3.7::
raw_ip::::
```
3. Go to the **main configuration file**. Then, find which website you want to setup a proxy for.
4. Modify the value `false` with `"myproxy"`, with quotes included and the semicolon at the end.
Done! The scraper you chose should now be using the rotating proxies. When asking for the next page of results, it will use the same proxy to avoid detection!
## Important!
If you ever test out a `socks5` proxy locally on your machine and find out it works but doesn't on your server, try supplying the `socks5_hostname` protocol instead. Hopefully this tip can save you 3 hours of your life!

View file

@ -1,152 +0,0 @@
#### Install guide for Docker
When using docker container any environment variables prefixed with `FOURGET_` will be added to the generated config located at `/var/www/html/4get/data/config.php`
When lists of data is expected in [data/config.php](../data/config.php), such as `INSTANCES`, you can pass in a comma separated string via environment variable.
Example:
`FOURGET_INSTANCES="https://4get.ca,https://domain.tld"`
#### Special environment variables
| Name | value | Example |
| - | - | - |
| FOURGET_PROTO | "http" or "https" | "https" |
#### Important directories
| Mountpoint | Description |
| - | - |
| /etc/4get/certs | SSL certificate directory |
| /var/www/html/4get/banner | Custom Banners directory |
| /var/www/html/4get/data/captcha | Captcha dataset |
the certificate directory `/etc/4get/certs` expects files named `fullchain.pem` and `privkey.pem`
The captcha dataset should have a subdirectory for each category. In each category, images should be named from 1.png to X.png, and be 100x100 in size.
example directory structure:
```
captcha/
birds/
1.png
2.png
3.png
anime/
1.png
2.png
```
For more information on configuration view [data/config.php](../data/config.php)
#### Usage
You can start 4get with
```
docker run -d -p 80:80 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_PROTO="http" luuul/4get:latest
```
...Or with SSL:
```
docker run -d -p 443:443 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_PROTO="https" -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs luuul/4get:latest
```
#### With Docker Compose
Replace relevant values and start with `docker compose up -d`
##### HTTP
```
# docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
restart: unless-stopped
environment:
- FOURGET_VERSION=6
- FOURGET_PROTO=http
- FOURGET_SERVER_NAME=4get.ca
ports:
- "80:80"
```
##### HTTPS
```
# docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
restart: unless-stopped
environment:
- FOURGET_VERSION=6
- FOURGET_PROTO=https
- FOURGET_SERVER_NAME=4get.ca
ports:
- "80:80"
- "443:443"
volumes:
- /etc/letsencrypt/live/domain.tld:/etc/4get/certs
```
##### Captcha Enabled
Set `FOURGET_BOT_PROTECTION=1` and mount a directory containing captcha files to `/var/www/html/4get/data/captcha`
```
# docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
restart: unless-stopped
environment:
- FOURGET_VERSION=6
- FOURGET_PROTO=http
- FOURGET_SERVER_NAME=4get.ca
- FOURGET_BOT_PROTECTION=1
ports:
- "80:80"
volumes:
- ./captcha:/var/www/html/4get/data/captcha
```
##### Custom Banners
```
# docker-compose.yaml
version: "3.7"
services:
fourget:
image: luuul/4get:latest
restart: unless-stopped
environment:
- FOURGET_VERSION=6
- FOURGET_PROTO=http
- FOURGET_SERVER_NAME=4get.ca
ports:
- "80:80"
volumes:
- ./banners:/var/www/html/4get/banner
```

View file

@ -1,103 +0,0 @@
# Install on NGINX
>I do NOT recommend following this guide, only follow this if you *really* need to use nginx. I recommend you use the apache2 steps instead.
Login as root.
Create a file in `/etc/nginx/sites-avaliable/` called `4get.conf` or any name you want and put this into the file:
```
server {
# DO YOU REALLY NEED TO LOG SEARCHES?
access_log /dev/null;
error_log /dev/null;
# Change this if you have 4get in other folder.
root /var/www/4get;
# Change yourdomain by your domain lol
server_name www.yourdomain.com yourdomain.com;
location @php {
try_files $uri.php $uri/index.php =404;
# Change the unix socket address if it's different for you.
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
# Change this to `fastcgi_params` if you use a debian based distro.
include fastcgi.conf;
fastcgi_intercept_errors on;
}
location / {
try_files $uri @php;
}
location ~* ^(.*)\.php$ {
return 301 $1;
}
listen 80;
}
```
That is a very basic config so you will need to adapt it to your needs in case you have a more complicated nginx configuration. Anyways, you can see a real world example [here](https://git.zzls.xyz/Fijxu/etc-configs/src/branch/selfhost/nginx/sites-available/4get.zzls.xyz.conf)
After you save the file you will need to do a symlink of the `4get.conf` file to `/etc/nignx/sites-enabled/`, you can do it with this command:
```sh
ln -s /etc/nginx/sites-available/4get.conf /etc/nginx/sites-available/4get.conf
```
Now test the nginx config with `nginx -t`, if it says that everything is good, restart nginx using `systemctl restart nginx`
# Encryption setup
Generate a certificate for the domain using:
```sh
certbot --nginx --key-type ecdsa -d www.yourdomain.com -d yourdomain.com
```
(Remember to install the nginx certbot plugin!!!)
After doing that certbot should deploy the certificate automatically into your 4get nginx config file. It should be ready to use at that point.
# Tor setup on NGINX
Important Note: Tor onion addresses are significantly longer than traditional domain names. Before proceeding with Nginx configuration, ensure you increase the `server_names_hash_bucket_size` value in your `nginx.conf` file. This setting in your Nginx configuration controls the internal data structure used to manage multiple server names (hostnames) associated with your web server. Each hostname requires a certain amount of memory within this structure. If the size is insufficient, Nginx will encounter errors.
1. Open your `nginx.conf` file (that is under `/etc/nginx/nginx.conf`).
2. Find the line containing `# server_names_hash_bucket_size 64;`.
3. Uncomment the line and adjust the value. Start with 64, but if you encounter issues, incrementally increase it (e.g., 128, 256) until it accommodates your configuration.
Open your current 4get NGINX config (that is under `/etc/nginx/sites-available/`) and append this to the end of the file:
```
server {
access_log /dev/null;
error_log /dev/null;
listen 80;
server_name <youronionaddress>;
root /var/www/4get;
location @php {
try_files $uri.php $uri/index.php =404;
# Change the unix socket address if it's different for you.
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
# Change this to `fastcgi_params` if you use a debian based distro.
include fastcgi.conf;
fastcgi_intercept_errors on;
}
location / {
try_files $uri @php;
}
location ~* ^(.*)\.php$ {
return 301 $1;
}
}
```
Obviously replace `<youronionaddress>` by the onion address of `/var/lib/tor/4get/hostname` and then check if the nginx config is valid with `nginx -t` if yes, then restart the nginx service and try opening the onion address into the Tor Browser. You can see a real world example [here](https://git.zzls.xyz/Fijxu/etc-configs/src/branch/selfhost/nginx/sites-available/4get.zzls.xyz.conf)
Once you did the above, refer to <a href="https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/tor.md">this tor guide</a> to setup your onionsite.

View file

@ -1,16 +0,0 @@
# Tor setup
This guide assumes that there is already a configured webserver sitting on port 80 waiting for localhost connections. The <a href="https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/apache2.md">apache2 guide</a> guides you through this.
1. Login as `root`.
2. Install `tor`.
3. Edit `/etc/tor/torrc`
4. Go to the line that contains `HiddenServiceDir` and `HiddenServicePort`, uncomment those 2 lines and set them like this:
```
HiddenServiceDir /var/lib/tor/4get
HiddenServicePort 80 127.0.0.1:80
```
5. Restart the tor service using `service tor restart`
6. Wait for a while...
7. Run `cat /var/lib/tor/4get/hostname`. That is your onion address!
# Specify your own tor address

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -200,7 +200,6 @@ class favicon{
/*
Download the favicon
*/
//$href = "https://git.lolcat.ca/assets/img/logo.svg";
try{
$payload =
@ -351,7 +350,7 @@ class favicon{
private function defaulticon(){
// give 404 and fuck off
// give 404
http_response_code(404);
$handle = fopen("lib/favicon404.png", "r");

1
favicon.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0" y="0" viewBox="9.047468185424805 6.566999912261963 71.9035415649414 71.9165267944336" enable-background="new 0 0 90 90" xml:space="preserve" height="76.78114675585286" width="76.76728317183762" class="icon-icon-0" data-fill-palette-color="accent" id="icon-0"><g fill="#096a2e" data-fill-palette-color="accent"><path fill="#096a2e" d="M37.496 31.645C37.593 32.499 37.737 33.333 37.874 34.098 38.431 37.203 39.589 40.275 40.913 43.13 43.116 47.882 46.849 51.54 52.206 52.085 54.268 52.295 56.433 51.948 58.509 51.219 59.083 51.328 59.722 51.175 60.158 50.601 60.178 50.575 60.194 50.549 60.214 50.524 62.89 49.284 65.31 47.444 67.017 45.387 70.586 41.089 70.683 34.755 68.977 29.673 67.21 24.412 63.085 20.191 58.282 17.577 53.584 15.021 46.551 13.492 41.789 16.632 37.409 19.522 36.956 25.731 36.926 30.455 36.921 31.005 37.157 31.397 37.496 31.645M64.997 30.13C64.978 30.073 64.963 30.016 64.943 29.959 64.974 29.959 65.004 29.964 65.035 29.959zM43.297 40.947C42.063 38.285 41.229 35.343 40.713 32.462 40.443 30.956 40.439 29.364 40.779 27.873 41.14 26.292 42.848 25.904 44.195 25.652 49.742 24.613 55.541 26.827 58.862 31.378 62.803 36.782 61.741 42.746 58.347 47.828A19.6 19.6 0 0 1 55.294 48.769C49.339 50.097 45.578 45.866 43.297 40.947" data-fill-palette-color="accent"></path><path fill="#096a2e" d="M80.951 34.337C80.951 18.954 62.75 6.567 47.68 6.567 34.076 6.567 26.273 16.689 26.273 34.337 26.273 37.507 26.794 40.609 27.82 43.568 26.842 45.156 22.312 49.718 19.245 52.805 12.314 59.784 9.674 62.606 9.372 64.406A0.76 0.76 0 0 0 9.25 64.822C9.212 67.232 8.491 71.055 10.022 73.315L10.023 73.334C10.035 73.734 10.348 74 10.689 74.074 11.1 74.437 11.551 74.729 12.032 74.97 13.413 76.788 16.014 78.015 18.072 78.464 18.638 78.588 19.188 78.104 19.024 77.512L19.003 77.437A0.75 0.75 0 0 0 19.599 77.234C22.816 74.31 26.644 72.27 30.274 69.925 31.887 68.883 33.352 67.691 34.836 66.479 35.261 66.131 35.669 65.761 36.072 65.387A64 64 0 0 0 43.411 66.108C44.069 66.183 44.745 66.248 45.433 66.301 47.486 66.544 49.567 66.764 51.615 66.758 53.697 67.019 55.927 66.992 57.66 66.104 57.945 66.071 58.23 66.042 58.515 65.998 62.461 65.393 65.811 63.769 68.555 61.394 71.334 60.314 73.322 57.12 74.728 54.743 76.123 52.388 77.492 49.552 78.086 46.692A27.95 27.95 0 0 0 80.951 34.337M26.46 67.758C26.126 67.912 25.785 68.059 25.447 68.207L27.008 67.386A16 16 0 0 1 26.46 67.758M29.662 68.043C29.942 67.904 30.219 67.756 30.496 67.608 30.087 67.942 29.669 68.264 29.243 68.575zM12.776 73.136C12.995 73.38 13.221 73.617 13.454 73.85 13.315 73.808 13.177 73.768 13.039 73.723A3.2 3.2 0 0 1 12.776 73.136M19.658 75.1L19.928 74.935C19.841 75.003 19.755 75.074 19.668 75.144zM21.807 55.351C30.81 46.286 32.066 44.653 31.403 42.863A24.5 24.5 0 0 1 29.884 34.338C29.884 25.316 32.196 10.18 47.68 10.18 61.032 10.18 77.341 21.327 77.341 34.338 77.341 47.659 66.695 58.496 53.612 58.496 49.755 58.496 46.075 57.584 42.679 55.785 42.256 55.561 41.757 55.447 41.195 55.447 36.469 55.447 22.574 64.857 18.048 68.285 17.595 68.628 17.301 68.628 17.205 68.628 16.203 68.628 14.849 67.278 13.179 64.616 14.323 62.886 18.771 58.407 21.807 55.351M16.432 76.246L16.501 76.345C16.371 76.291 16.242 76.237 16.113 76.177z" data-fill-palette-color="accent"></path></g></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

View file

@ -1,7 +1,7 @@
<?php
/*
Initialize random shit
Initialize random stuff
*/
include "data/config.php";

View file

@ -14,7 +14,7 @@ class backend{
$pool = constant("config::PROXY_" . strtoupper($this->scraper));
if($pool === false){
// we don't want a proxy, fuck off!
// No proxy, please
return 'raw_ip::::';
}

View file

@ -1,7 +1,7 @@
<?php
// https://www.bing.com/search?q=url%3Ahttps%3A%2F%2Flolcat.ca
// https://cc.bingj.com/cache.aspx?q=url%3ahttps%3a%2f%2flolcat.ca&d=4769685974291356&mkt=en-CA&setlang=en-US&w=tEsWuE7HW3Z5AIPQMVkDH4WaotS4LrK-
// https://www.bing.com/search?q=url%3Ahttps%3A%2F%sudovanilla
// https://cc.bingj.com/cache.aspx?q=url%3ahttps%3a%2f%sudovanilla&d=4769685974291356&mkt=en-CA&setlang=en-US&w=tEsWuE7HW3Z5AIPQMVkDH4WaotS4LrK-
// <div class="b_attribution" u="0N|5119|4769685974291356|tEsWuE7HW3Z5AIPQMVkDH4WaotS4LrK-" tabindex="0">
new bingcache();
@ -90,7 +90,7 @@ class bingcache{
$frontend->load(
"error.html",
[
"title" => "Shit",
"title" => "Welp!",
"text" => $text
]
);

View file

@ -207,7 +207,7 @@ class proxy{
function($downloadsize, $downloaded, $uploadsize, $uploaded
){
// if $downloaded exceeds 100MB, fuck off
// if $downloaded exceeds 100MB
return ($downloaded > 100000000) ? 1 : 0;
});
@ -631,7 +631,7 @@ class proxy{
){
// format could not be found, but imagemagick can
// sometimes detect it? shit's fucked
// sometimes detect it?
$format = false;
}

View file

@ -119,7 +119,7 @@ class frontend{
$this->drawerror(
"Tshh, blocked!",
'Your browser, IP or IP range has been blocked from this 4get instance. If this is an error, please <a href="/about">contact the administrator</a>.'
'Your browser, IP or IP range has been blocked from this NarviSearch instance. If this is an error, please <a href="/about">contact the administrator</a>.'
);
die();
}
@ -155,14 +155,14 @@ class frontend{
}
$this->drawerror(
"Shit",
"Oh no!",
'This scraper returned an error:' .
'<div class="code">' . htmlspecialchars($error) . '</div>' .
'Things you can try:' .
'<ul>' .
'<li>Use a different scraper</li>' .
'<li>Remove keywords that could cause errors</li>' .
'<li><a href="/instances?target=' . $target . "&" . $this->buildquery($get, false) . '">Try your search on another 4get instance</a></li>' .
'<li><a href="/instances?target=' . $target . "&" . $this->buildquery($get, false) . '">Try your search on another NarviSearch instance</a></li>' .
'</ul><br>' .
'If the error persists, please <a href="/about">contact the administrator</a>.',
$timetaken
@ -470,7 +470,6 @@ class frontend{
$archives = [];
$path = explode("/", $host["path"]);
$count = count($path);
// /pol/thread/417568063/post-shitty-memes-if-you-want-to
if($count !== 0){

View file

@ -1,5 +1,5 @@
<?php
class fuckhtml{
class heckhtml{
public function __construct($html = null, $isfile = false){

View file

@ -9,7 +9,7 @@
if(!empty($bang)){
// !youtube
$conn = pg_connect("host=localhost dbname=4get user=postgres password=postgres");
$conn = pg_connect("host=localhost dbname=narvisearch user=postgres password=postgres");
pg_prepare($conn, "bang_get", "SELECT bang,name FROM bangs WHERE bang LIKE $1 ORDER BY bang ASC LIMIT 8");
$q = pg_execute($conn, "bang_get", ["$bang%"]);
@ -77,7 +77,7 @@
if(!empty($bang)){
// check if the bang exists
$conn = pg_connect("host=localhost dbname=4get user=postgres password=postgres");
$conn = pg_connect("host=localhost dbname=narvisearch user=postgres password=postgres");
pg_prepare($conn, "bang_get_single", "SELECT bang,name FROM bangs WHERE bang = $1 LIMIT 1");
$q = pg_execute($conn, "bang_get_single", [$bang]);

View file

@ -1,13 +1 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2023 lolcat <will@lolcat.ca>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
so yeah uh. this mine now.

View file

@ -1,7 +1,7 @@
<?php
/*
Initialize random shit
Initialize random stuff
*/
include "data/config.php";

View file

@ -1,7 +1,7 @@
<?php
/*
Initialize random shit
Initialize random stuff
*/
include "data/config.php";

View file

@ -18,8 +18,7 @@ class calculator extends oracle {
}
return true;
}
// a custom parser and calculator because FUCK YUO, libraries are
// gay.
// a custom parser, because yes
public function generate_response($q)
{
$nums = str_split("1234567890.");

View file

@ -1,28 +1,4 @@
# When the robots.txt is sus
# ⠀⠀⠀⡯⡯⡾⠝⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠘⡮⣣⠪⠢⡑⡌
# ⠀⠀⠀⠟⠝⠈⠀⠀⠀⠡⠀⠠⢈⠠⢐⢠⢂⢔⣐⢄⡂⢔⠀⡁⢉⠸⢨⢑⠕⡌
# ⠀⠀⡀⠁⠀⠀⠀⡀⢂⠡⠈⡔⣕⢮⣳⢯⣿⣻⣟⣯⣯⢷⣫⣆⡂⠀⠀⢐⠑⡌
# ⢀⠠⠐⠈⠀⢀⢂⠢⡂⠕⡁⣝⢮⣳⢽⡽⣾⣻⣿⣯⡯⣟⣞⢾⢜⢆⠀⡀⠀⠪
# ⣬⠂⠀⠀⢀⢂⢪⠨⢂⠥⣺⡪⣗⢗⣽⢽⡯⣿⣽⣷⢿⡽⡾⡽⣝⢎⠀⠀⠀⢡
# ⣿⠀⠀⠀⢂⠢⢂⢥⢱⡹⣪⢞⡵⣻⡪⡯⡯⣟⡾⣿⣻⡽⣯⡻⣪⠧⠑⠀⠁⢐
# ⣿⠀⠀⠀⠢⢑⠠⠑⠕⡝⡎⡗⡝⡎⣞⢽⡹⣕⢯⢻⠹⡹⢚⠝⡷⡽⡨⠀⠀⢔
# ⣿⡯⠀⢈⠈⢄⠂⠂⠐⠀⠌⠠⢑⠱⡱⡱⡑⢔⠁⠀⡀⠐⠐⠐⡡⡹⣪⠀⠀⢘
# ⣿⣽⠀⡀⡊⠀⠐⠨⠈⡁⠂⢈⠠⡱⡽⣷⡑⠁⠠⠑⠀⢉⢇⣤⢘⣪⢽⠀⢌⢎
# ⣿⢾⠀⢌⠌⠀⡁⠢⠂⠐⡀⠀⢀⢳⢽⣽⡺⣨⢄⣑⢉⢃⢭⡲⣕⡭⣹⠠⢐⢗
# ⣿⡗⠀⠢⠡⡱⡸⣔⢵⢱⢸⠈⠀⡪⣳⣳⢹⢜⡵⣱⢱⡱⣳⡹⣵⣻⢔⢅⢬⡷
# ⣷⡇⡂⠡⡑⢕⢕⠕⡑⠡⢂⢊⢐⢕⡝⡮⡧⡳⣝⢴⡐⣁⠃⡫⡒⣕⢏⡮⣷⡟
# ⣷⣻⣅⠑⢌⠢⠁⢐⠠⠑⡐⠐⠌⡪⠮⡫⠪⡪⡪⣺⢸⠰⠡⠠⠐⢱⠨⡪⡪⡰
# ⣯⢷⣟⣇⡂⡂⡌⡀⠀⠁⡂⠅⠂⠀⡑⡄⢇⠇⢝⡨⡠⡁⢐⠠⢀⢪⡐⡜⡪⡊
# ⣿⢽⡾⢹⡄⠕⡅⢇⠂⠑⣴⡬⣬⣬⣆⢮⣦⣷⣵⣷⡗⢃⢮⠱⡸⢰⢱⢸⢨⢌
# ⣯⢯⣟⠸⣳⡅⠜⠔⡌⡐⠈⠻⠟⣿⢿⣿⣿⠿⡻⣃⠢⣱⡳⡱⡩⢢⠣⡃⠢⠁
# ⡯⣟⣞⡇⡿⣽⡪⡘⡰⠨⢐⢀⠢⢢⢄⢤⣰⠼⡾⢕⢕⡵⣝⠎⢌⢪⠪⡘⡌⠀
# ⡯⣳⠯⠚⢊⠡⡂⢂⠨⠊⠔⡑⠬⡸⣘⢬⢪⣪⡺⡼⣕⢯⢞⢕⢝⠎⢻⢼⣀⠀
# ⠁⡂⠔⡁⡢⠣⢀⠢⠀⠅⠱⡐⡱⡘⡔⡕⡕⣲⡹⣎⡮⡏⡑⢜⢼⡱⢩⣗⣯⣟
# ⢀⢂⢑⠀⡂⡃⠅⠊⢄⢑⠠⠑⢕⢕⢝⢮⢺⢕⢟⢮⢊⢢⢱⢄⠃⣇⣞⢞⣞⢾
# ⢀⠢⡑⡀⢂⢊⠠⠁⡂⡐⠀⠅⡈⠪⠪⠪⠣⠫⠑⡁⢔⠕⣜⣜⢦⡰⡎⡯⡾⡽
User-agent: *
Disallow:
Host: 4get.ca
Sitemap: https://4get.ca/sitemap
Host: search.sudovanilla.org
Sitemap: https://search.sudovanilla.org/sitemap

View file

@ -4,8 +4,8 @@ class brave{
public function __construct(){
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
include "lib/backend.php";
$this->backend = new backend("brave");
@ -327,13 +327,13 @@ class brave{
];
// load html
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
/*
Get next page "token"
*/
$nextpage =
$this->fuckhtml
$this->heckhtml
->getElementById(
"pagination",
"div"
@ -341,10 +341,10 @@ class brave{
if($nextpage){
$this->fuckhtml->load($nextpage);
$this->heckhtml->load($nextpage);
$nextpage =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("btn", "a");
if(count($nextpage) !== 0){
@ -354,7 +354,7 @@ class brave{
if(
strtolower(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$nextpage
)
@ -363,7 +363,7 @@ class brave{
preg_match(
'/offset=([0-9]+)/',
$this->fuckhtml->getTextContent($nextpage["attributes"]["href"]),
$this->heckhtml->getTextContent($nextpage["attributes"]["href"]),
$nextpage
);
@ -381,10 +381,10 @@ class brave{
}
}
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$script_disc =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName(
"script"
);
@ -410,7 +410,7 @@ class brave{
}
$data =
$this->fuckhtml
$this->heckhtml
->parseJsObject(
$grep[1]
);
@ -458,7 +458,7 @@ class brave{
"title" => $this->titledots($cluster["title"]),
"description" =>
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$cluster["description"]
)
@ -776,7 +776,7 @@ class brave{
)
) :
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$result["description"]
)
@ -902,9 +902,9 @@ class brave{
}
$table[
$this->fuckhtml->getTextContent($row[0])
$this->heckhtml->getTextContent($row[0])
] =
$this->fuckhtml->getTextContent($row[1]);
$this->heckhtml->getTextContent($row[1]);
}
}
@ -913,7 +913,7 @@ class brave{
foreach($info["profiles"] as $row){
$name = $this->fuckhtml->getTextContent($row["name"]);
$name = $this->heckhtml->getTextContent($row["name"]);
if(strtolower($name) == "steampowered"){
@ -921,14 +921,14 @@ class brave{
}
$sublink[
$this->fuckhtml->getTextContent($name)
$this->heckhtml->getTextContent($name)
] =
$this->fuckhtml->getTextContent($row["url"]);
$this->heckhtml->getTextContent($row["url"]);
}
}
$out["answer"][] = [
"title" => $this->fuckhtml->getTextContent($info["title"]),
"title" => $this->heckhtml->getTextContent($info["title"]),
"description" => $description,
"url" => $info["url"],
"thumb" => isset($info["images"][0]["original"]) ? $info["images"][0]["original"] : null,
@ -957,7 +957,7 @@ class brave{
isset($video["thumbnail"]["src"]) ?
[
"ratio" => "16:9",
"url" => $this->unshiturl($video["thumbnail"]["src"])
"url" => $this->fixURLthingie($video["thumbnail"]["src"])
] :
[
"ratio" => null,
@ -983,7 +983,7 @@ class brave{
isset($video["thumbnail"]["src"]) ?
[
"ratio" => "16:9",
"url" => $this->unshiturl($video["thumbnail"]["src"])
"url" => $this->fixURLthingie($video["thumbnail"]["src"])
] :
[
"ratio" => null,
@ -1023,7 +1023,7 @@ class brave{
"description" =>
$this->limitstrlen(
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$disc["description"]
)
@ -1128,7 +1128,7 @@ class brave{
];
// load html
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
// get npt
$out["npt"] =
@ -1152,7 +1152,7 @@ class brave{
throw new Exception("Failed to grep javascript object");
}
$json = $this->fuckhtml->parseJsObject($json[1], true);
$json = $this->heckhtml->parseJsObject($json[1], true);
if($json === null){
@ -1176,7 +1176,7 @@ class brave{
}else{
$thumb = [
"url" => $this->unshiturl($news["thumbnail"]["src"]),
"url" => $this->fixURLthingie($news["thumbnail"]["src"]),
"ratio" => "16:9"
];
}
@ -1251,7 +1251,7 @@ class brave{
}
$json =
$this->fuckhtml
$this->heckhtml
->parseJsObject(
$json[1]
);
@ -1356,7 +1356,7 @@ class brave{
}
}
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$out = [
"status" => "ok",
@ -1396,7 +1396,7 @@ class brave{
}
$json =
$this->fuckhtml
$this->heckhtml
->parseJsObject(
$json[1]
);
@ -1461,20 +1461,20 @@ class brave{
$i = 0;
$answer = [];
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
foreach(
$this->fuckhtml->getElementsByTagName("*")
$this->heckhtml->getElementsByTagName("*")
as $snippet
){
switch($snippet["tagName"]){
case "p":
$this->fuckhtml->load($snippet["innerHTML"]);
$this->heckhtml->load($snippet["innerHTML"]);
$codetags =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("*");
$tmphtml = $snippet["innerHTML"];
@ -1493,7 +1493,7 @@ class brave{
2
);
$value = $this->fuckhtml->getTextContent($tmphtml[0], false, false);
$value = $this->heckhtml->getTextContent($tmphtml[0], false, false);
$this->appendtext($value, $answer, $i);
$type = null;
@ -1506,7 +1506,7 @@ class brave{
}
if($type !== null){
$value = $this->fuckhtml->getTextContent($tag, false, true);
$value = $this->heckhtml->getTextContent($tag, false, true);
if(trim($value) != ""){
@ -1542,7 +1542,7 @@ class brave{
if(strlen($tmphtml) !== 0){
$value = $this->fuckhtml->getTextContent($tmphtml, false, false);
$value = $this->heckhtml->getTextContent($tmphtml, false, false);
$this->appendtext($value, $answer, $i);
}
break;
@ -1551,7 +1551,7 @@ class brave{
$answer[] = [
"type" => "image",
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$tag["attributes"]["src"]
)
@ -1574,7 +1574,7 @@ class brave{
"type" => "code",
"value" =>
rtrim(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$snippet,
true,
@ -1589,9 +1589,9 @@ class brave{
case "ol":
$o = 0;
$this->fuckhtml->load($snippet);
$this->heckhtml->load($snippet);
$li =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("li");
foreach($li as $elem){
@ -1599,7 +1599,7 @@ class brave{
$this->appendtext(
$o . ". " .
$this->fuckhtml
$this->heckhtml
->getTextContent(
$elem
),
@ -1683,7 +1683,7 @@ class brave{
$html =
explode(
":",
$this->fuckhtml->getTextContent($html),
$this->heckhtml->getTextContent($html),
2
);
@ -1699,7 +1699,7 @@ class brave{
private function getimagelinkfromstyle($thumb){
$thumb =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
$thumb,
"div"
@ -1721,7 +1721,7 @@ class brave{
$thumb
);
$url = $this->fuckhtml->getTextContent($this->unshiturl(trim($thumb[1], '"\' ')));
$url = $this->heckhtml->getTextContent($this->fixURLthingie(trim($thumb[1], '"\' ')));
if(parse_url($url, PHP_URL_HOST) == "cdn.search.brave.com"){
@ -1770,7 +1770,7 @@ class brave{
private function generatenextpagetoken($q, $nsfw, $country, $spellcheck, $page, $proxy){
$nextpage =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("btn", "a");
if(count($nextpage) !== 0){
@ -1780,7 +1780,7 @@ class brave{
if(
strtolower(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$nextpage
)
@ -1789,7 +1789,7 @@ class brave{
preg_match(
'/offset=([0-9]+)/',
$this->fuckhtml->getTextContent($nextpage["attributes"]["href"]),
$this->heckhtml->getTextContent($nextpage["attributes"]["href"]),
$nextpage
);
@ -1813,7 +1813,7 @@ class brave{
return null;
}
private function unshiturl($url){
private function fixURLthingie($url){
// https://imgs.search.brave.com/XFnbR8Sl7ge82MBDEH7ju0UHImRovMVmQ2qnDvgNTuA/rs:fit:844:225:1/g:ce/aHR0cHM6Ly90c2U0/Lm1tLmJpbmcubmV0/L3RoP2lkPU9JUC54/UWotQXU5N2ozVndT/RDJnNG9BNVhnSGFF/SyZwaWQ9QXBp.jpeg

View file

@ -7,8 +7,8 @@ class crowdview{
include "lib/backend.php";
$this->backend = new backend("crowdview");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
}
public function getfilters($page){
@ -133,7 +133,7 @@ class crowdview{
return
trim(
$this->fuckhtml
$this->heckhtml
->getTextContent(
html_entity_decode(
$html

View file

@ -7,8 +7,8 @@ class curlie{
include "lib/backend.php";
$this->backend = new backend("curlie");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
}
public function getfilters($page){
@ -208,10 +208,10 @@ class curlie{
}
}
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$nextpage =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"next-page",
"a"
@ -247,7 +247,7 @@ class curlie{
];
$items =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"site-item",
"div"
@ -255,10 +255,10 @@ class curlie{
foreach($items as $item){
$this->fuckhtml->load($item);
$this->heckhtml->load($item);
$a =
$this->fuckhtml
$this->heckhtml
->getElementsByAttributeValue(
"target",
"_blank",
@ -266,13 +266,13 @@ class curlie{
)[0];
$description =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("site-descr");
if(count($description) !== 0){
$description =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$description[0]
);
@ -283,13 +283,13 @@ class curlie{
$out["web"][] = [
"title" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a
),
"description" => $description,
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["href"]
),

View file

@ -7,8 +7,8 @@ class ddg{
include "lib/backend.php";
$this->backend = new backend("ddg");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
}
/*
@ -1288,18 +1288,18 @@ class ddg{
}
/*
Get shitcoin conversions
Get coin conversions
*/
if($extendedsearch){
if(
preg_match(
'/"https?:\/\/(?:www\.coinbase\.com\/converter\/([a-z0-9]+)\/([a-z0-9]+)|changelly\.com\/exchange\/([a-z0-9]+)\/([a-z0-9]+)|coinmarketcap\.com\/currencies\/[a-z0-9]+\/([a-z0-9]+)\/([a-z0-9]+))\/?"/',
$js,
$shitcoins
$coins
)
){
$shitcoins = array_values(array_filter($shitcoins));
$coins = array_values(array_filter($coins));
preg_match(
'/(?:[\s,.]*[0-9]+)+/',
@ -1319,28 +1319,28 @@ class ddg{
$description = [];
$shitcoinjs = $this->get(
$coinjs = $this->get(
$proxy,
"https://duckduckgo.com/js/spice/cryptocurrency/{$shitcoins[1]}/{$shitcoins[2]}/1",
"https://duckduckgo.com/js/spice/cryptocurrency/{$coins[1]}/{$coins[2]}/1",
[],
ddg::req_xhr
);
preg_match(
'/ddg_spice_cryptocurrency\(\s*({[\S\s]*})\s*\);/',
$shitcoinjs,
$shitcoinjson
$coinjs,
$coinjson
);
$shitcoinjson = json_decode($shitcoinjson[1], true);
$coinjson = json_decode($coinjson[1], true);
if(
!isset($shitcoinjson["error"]) &&
$shitcoinjson["status"]["error_code"] == 0
!isset($coinjson["error"]) &&
$coinjson["status"]["error_code"] == 0
){
$shitcoinjson = $shitcoinjson["data"];
$array_values = array_values($shitcoinjson["quote"])[0];
$coinjson = $coinjson["data"];
$array_values = array_values($coinjson["quote"])[0];
if($amount != 1){
@ -1353,8 +1353,8 @@ class ddg{
$description[] = [
"type" => "text",
"value" =>
"{$amount} {$shitcoinjson["name"]} ({$shitcoinjson["symbol"]}) = " . $this->number_format($array_values["price"] * $amount) . " " . strtoupper($shitcoins[2]) . "\n" .
"{$amount} " . strtoupper($shitcoins[2]) . " = " . $this->number_format((1 / $array_values["price"]) * $amount) . " {$shitcoinjson["symbol"]}"
"{$amount} {$coinjson["name"]} ({$coinjson["symbol"]}) = " . $this->number_format($array_values["price"] * $amount) . " " . strtoupper($coins[2]) . "\n" .
"{$amount} " . strtoupper($coins[2]) . " = " . $this->number_format((1 / $array_values["price"]) * $amount) . " {$coinjson["symbol"]}"
];
}
@ -1367,19 +1367,19 @@ class ddg{
$description[] = [
"type" => "text",
"value" =>
"1 {$shitcoinjson["name"]} ({$shitcoinjson["symbol"]}) = " . $this->number_format($array_values["price"]) . " " . strtoupper($shitcoins[2]) . "\n" .
"1 " . strtoupper($shitcoins[2]) . " = " . $this->number_format(1 / $array_values["price"]) . " {$shitcoinjson["symbol"]}"
"1 {$coinjson["name"]} ({$coinjson["symbol"]}) = " . $this->number_format($array_values["price"]) . " " . strtoupper($coins[2]) . "\n" .
"1 " . strtoupper($coins[2]) . " = " . $this->number_format(1 / $array_values["price"]) . " {$coinjson["symbol"]}"
];
$description[] = [
"type" => "quote",
"value" => "Last fetched: " . date("jS \of F Y @ g:ia", strtotime($shitcoinjson["last_updated"]))
"value" => "Last fetched: " . date("jS \of F Y @ g:ia", strtotime($coinjson["last_updated"]))
];
$out["answer"][] = [
"title" => $shitcoinjson["name"] . " (" . strtoupper($shitcoins[1]) . ") & " . strtoupper($shitcoins[2]) . " market",
"title" => $coinjson["name"] . " (" . strtoupper($coins[1]) . ") & " . strtoupper($coins[2]) . " market",
"description" => $description,
"url" => "https://coinmarketcap.com/converter/" . strtoupper($shitcoins[1]) . "/" . strtoupper($shitcoins[2]) . "/?amt={$amount}",
"url" => "https://coinmarketcap.com/converter/" . strtoupper($coins[1]) . "/" . strtoupper($coins[2]) . "/?amt={$amount}",
"thumb" => null,
"table" => [],
"sublink" => []
@ -2470,9 +2470,9 @@ class ddg{
$i = 0;
$answer = [];
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$tags = $this->fuckhtml->getElementsByTagName("*");
$tags = $this->heckhtml->getElementsByTagName("*");
if(count($tags) === 0){
@ -2489,10 +2489,10 @@ class ddg{
switch($snippet["tagName"]){
case "p":
$this->fuckhtml->load($snippet["innerHTML"]);
$this->heckhtml->load($snippet["innerHTML"]);
$codetags =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("*");
$tmphtml = $snippet["innerHTML"];
@ -2511,7 +2511,7 @@ class ddg{
2
);
$value = $this->fuckhtml->getTextContent($tmphtml[0], false, false);
$value = $this->heckhtml->getTextContent($tmphtml[0], false, false);
$this->appendtext($value, $answer, $i);
$type = null;
@ -2524,7 +2524,7 @@ class ddg{
}
if($type !== null){
$value = $this->fuckhtml->getTextContent($tag, false, false);
$value = $this->heckhtml->getTextContent($tag, false, false);
if(trim($value) != ""){
@ -2552,7 +2552,7 @@ class ddg{
if(strlen($tmphtml) !== 0){
$value = $this->fuckhtml->getTextContent($tmphtml, true, false);
$value = $this->heckhtml->getTextContent($tmphtml, true, false);
$this->appendtext($value, $answer, $i);
}
break;
@ -2561,7 +2561,7 @@ class ddg{
$answer[] = [
"type" => "image",
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$tag["attributes"]["src"]
)
@ -2583,7 +2583,7 @@ class ddg{
"type" => "code",
"value" =>
rtrim(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$snippet,
true,
@ -2598,9 +2598,9 @@ class ddg{
case "ol":
$o = 0;
$this->fuckhtml->load($snippet);
$this->heckhtml->load($snippet);
$li =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("li");
foreach($li as $elem){
@ -2608,7 +2608,7 @@ class ddg{
$this->appendtext(
$o . ". " .
$this->fuckhtml
$this->heckhtml
->getTextContent(
$elem
),

File diff suppressed because it is too large Load diff

View file

@ -7,8 +7,8 @@ class greppr{
include "lib/backend.php";
$this->backend = new backend("greppr");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
}
public function getfilters($page){
@ -202,7 +202,7 @@ class greppr{
return $this->web($get, false);
}
// refresh the token with new data (this also triggers fuckhtml load)
// refresh the token with new data (this also triggers heckhtml load)
$this->parse_token($searchresults, $tokens[2]);
// response object
@ -224,7 +224,7 @@ class greppr{
// get results for later
$results =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"result",
"div"
@ -232,7 +232,7 @@ class greppr{
// check for next page
$next_elem =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"pagination",
"ul"
@ -240,10 +240,10 @@ class greppr{
if(count($next_elem) !== 0){
$this->fuckhtml->load($next_elem[0]);
$this->heckhtml->load($next_elem[0]);
$as =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"page-link",
"a"
@ -255,7 +255,7 @@ class greppr{
if($break === true){
parse_str(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["href"]
),
@ -288,16 +288,16 @@ class greppr{
// scrape results
foreach($results as $result){
$this->fuckhtml->load($result);
$this->heckhtml->load($result);
$a =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName(
"a"
)[0];
$description =
$this->fuckhtml
$this->heckhtml
->getElementsByFuzzyAttributeValue(
"style",
"color:#777777;",
@ -310,14 +310,14 @@ class greppr{
}else{
$description =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$description[0]
);
}
$date =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName(
"p"
);
@ -326,7 +326,7 @@ class greppr{
strtotime(
explode(
"Added:",
$this->fuckhtml
$this->heckhtml
->getTextContent(
$date[count($date) - 1]["innerHTML"]
)
@ -335,13 +335,13 @@ class greppr{
$out["web"][] = [
"title" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["innerHTML"]
),
"description" => $description,
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["href"]
),
@ -361,10 +361,10 @@ class greppr{
private function parse_token($response, $cookie = false){
$this->fuckhtml->load($response["data"]);
$this->heckhtml->load($response["data"]);
$scripts =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("script");
$found = false;

View file

@ -4,8 +4,8 @@ class imgur{
public function __construct(){
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
include "lib/backend.php";
$this->backend = new backend("imgur");
@ -182,10 +182,10 @@ class imgur{
throw new Exception("Failed to fetch HTML");
}
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$posts =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"post",
"div"
@ -193,17 +193,17 @@ class imgur{
foreach($posts as $post){
$this->fuckhtml->load($post);
$this->heckhtml->load($post);
$image =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("img")[0];
$image_url = "https:" . substr($this->fuckhtml->getTextContent($image["attributes"]["src"]), 0, -5);
$image_url = "https:" . substr($this->heckhtml->getTextContent($image["attributes"]["src"]), 0, -5);
$out["image"][] = [
"title" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$image["attributes"]["alt"]
),
@ -221,9 +221,9 @@ class imgur{
],
"url" =>
"https://imgur.com" .
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"image-list-link",
"a"

View file

@ -3,8 +3,8 @@
class marginalia{
public function __construct(){
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
include "lib/backend.php";
$this->backend = new backend("marginalia");
@ -293,10 +293,10 @@ class marginalia{
throw new Exception("Failed to get HTML");
}
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$sections =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"card search-result",
"section"
@ -304,17 +304,17 @@ class marginalia{
foreach($sections as $section){
$this->fuckhtml->load($section);
$this->heckhtml->load($section);
$title =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"title",
"a"
)[0];
$description =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"description",
"p"
@ -323,7 +323,7 @@ class marginalia{
if(count($description) !== 0){
$description =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$description[0]
);
@ -334,29 +334,29 @@ class marginalia{
$sublinks = [];
$sublink_html =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("additional-results");
if(count($sublink_html) !== 0){
$this->fuckhtml->load($sublink_html[0]);
$this->heckhtml->load($sublink_html[0]);
$links =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("a");
foreach($links as $link){
$sublinks[] = [
"title" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$link
),
"date" => null,
"description" => null,
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$link["attributes"]["href"]
)
@ -366,13 +366,13 @@ class marginalia{
$out["web"][] = [
"title" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$title
),
"description" => $description,
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$title["attributes"]["href"]
),

View file

@ -3,8 +3,8 @@
class mojeek{
public function __construct(){
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
include "lib/backend.php";
$this->backend = new backend("mojeek");
@ -524,10 +524,10 @@ class mojeek{
"related" => []
];
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$results =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("results-standard", "ul");
if(count($results) === 0){
@ -540,9 +540,9 @@ class mojeek{
*/
foreach($results as $container){
$this->fuckhtml->load($container);
$this->heckhtml->load($container);
$results =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("li");
foreach($results as $result){
@ -561,15 +561,15 @@ class mojeek{
"table" => []
];
$this->fuckhtml->load($result);
$this->heckhtml->load($result);
$title =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("title", "a")[0];
$data["title"] =
html_entity_decode(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$title["innerHTML"]
)
@ -577,14 +577,14 @@ class mojeek{
$data["url"] =
html_entity_decode(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$title["attributes"]["href"]
)
);
$description =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"s", "p"
);
@ -594,7 +594,7 @@ class mojeek{
$data["description"] =
$this->titledots(
html_entity_decode(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$description[0]
)
@ -603,7 +603,7 @@ class mojeek{
}
$date =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"mdate",
"span"
@ -613,7 +613,7 @@ class mojeek{
$data["date"] =
strtotime(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$date[0]
)
@ -627,10 +627,10 @@ class mojeek{
/*
Get instant answers
*/
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$infoboxes =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"infobox infobox-top",
"div"
@ -654,19 +654,19 @@ class mojeek{
$infobox["innerHTML"]
);
$this->fuckhtml->load($infobox_html[0]);
$this->heckhtml->load($infobox_html[0]);
// title
$answer["title"] =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("h1")[0]
);
// short definition
$definition =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName(
"p"
);
@ -676,7 +676,7 @@ class mojeek{
$answer["description"][] = [
"type" => "quote",
"value" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$definition[0]
)
@ -684,10 +684,10 @@ class mojeek{
}
// get thumbnail, if it exists
$this->fuckhtml->load($infobox_html[1]);
$this->heckhtml->load($infobox_html[1]);
$thumb =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("float-right", "img");
if(count($thumb) !== 0){
@ -701,7 +701,7 @@ class mojeek{
if(count($thumb) === 2){
$answer["thumb"] =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$thumb[1]
);
@ -710,13 +710,13 @@ class mojeek{
// get description
$ps =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("p");
$first_tag = true;
foreach($ps as $p){
$this->fuckhtml->load($p);
$this->heckhtml->load($p);
if(
preg_match(
@ -730,7 +730,7 @@ class mojeek{
*/
$strong =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("strong")[0];
$p["innerHTML"] =
@ -741,7 +741,7 @@ class mojeek{
'/:$/',
"",
ucfirst(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$strong
)
@ -750,7 +750,7 @@ class mojeek{
$answer["table"][trim($strong)] =
trim(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$p
)
@ -760,7 +760,7 @@ class mojeek{
}
$as =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("svg-icon");
if(count($as) !== 0){
@ -773,7 +773,7 @@ class mojeek{
$answer["sublink"][
ucfirst(explode(" ", $a["attributes"]["class"], 2)[1])
] =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["href"]
);
@ -786,7 +786,7 @@ class mojeek{
Parse text content
*/
$tags =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("*");
$i = 0;
@ -830,7 +830,7 @@ class mojeek{
case "a":
$value =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$tag
);
@ -847,12 +847,12 @@ class mojeek{
$answer["description"][] = [
"type" => "link",
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$tag["attributes"]["href"]
),
"value" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$tag
)
@ -865,12 +865,12 @@ class mojeek{
}
// get URL
$this->fuckhtml->load($infobox_html[2]);
$this->heckhtml->load($infobox_html[2]);
$answer["url"] =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByTagName(
"a"
)[0]
@ -885,10 +885,10 @@ class mojeek{
/*
Get news
*/
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$news =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"results news-results",
"div"
@ -896,18 +896,18 @@ class mojeek{
if(count($news) !== 0){
$this->fuckhtml->load($news[0]);
$this->heckhtml->load($news[0]);
$lis =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("li");
foreach($lis as $li){
$this->fuckhtml->load($li);
$this->heckhtml->load($li);
$a =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"ob",
"a"
@ -923,9 +923,9 @@ class mojeek{
$date =
explode(
" - ",
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByTagName(
"span"
)[0]
@ -940,7 +940,7 @@ class mojeek{
$out["news"][] = [
"title" =>
html_entity_decode(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a
)
@ -952,7 +952,7 @@ class mojeek{
"ratio" => null
],
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["href"]
)
@ -963,17 +963,17 @@ class mojeek{
/*
Get next page
*/
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$pagination =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName("pagination");
if(count($pagination) !== false){
$this->fuckhtml->load($pagination[0]);
$this->heckhtml->load($pagination[0]);
$as =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("a");
foreach($as as $a){
@ -981,7 +981,7 @@ class mojeek{
if($a["innerHTML"] == "Next"){
$out["npt"] = $this->backend->store(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["href"]
),
@ -1030,14 +1030,14 @@ class mojeek{
fclose($handle);
*/
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$articles =
$this->fuckhtml->getElementsByTagName("article");
$this->heckhtml->getElementsByTagName("article");
foreach($articles as $article){
$this->fuckhtml->load($article);
$this->heckhtml->load($article);
$data = [
"title" => null,
@ -1052,27 +1052,27 @@ class mojeek{
"url" => null
];
$a = $this->fuckhtml->getElementsByTagName("a")[0];
$a = $this->heckhtml->getElementsByTagName("a")[0];
$data["title"] =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["title"]
);
$data["url"] =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a["attributes"]["href"]
);
$p = $this->fuckhtml->getElementsByTagName("p");
$p = $this->heckhtml->getElementsByTagName("p");
$data["description"] =
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"s",
$p
@ -1087,7 +1087,7 @@ class mojeek{
// get date from big node
$date =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"date",
$p
@ -1097,7 +1097,7 @@ class mojeek{
$data["date"] =
strtotime(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$date[0]
)
@ -1106,16 +1106,16 @@ class mojeek{
// grep date + author
$s =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"i",
$p
)[0];
$this->fuckhtml->load($s);
$this->heckhtml->load($s);
$a =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("a");
if(count($a) !== 0){
@ -1123,7 +1123,7 @@ class mojeek{
// parse big node information
$data["author"] =
htmlspecialchars_decode(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$a[0]["innerHTML"]
)
@ -1132,12 +1132,12 @@ class mojeek{
// parse smaller nodes
$replace =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("time")[0];
$data["date"] =
strtotime(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$replace
)

View file

@ -7,8 +7,8 @@ class mwmbl{
include "lib/backend.php";
$this->backend = new backend("mwmbl");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
}
public function getfilters($page){
@ -98,10 +98,10 @@ class mwmbl{
"related" => []
];
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$results =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"result",
"li"
@ -109,18 +109,18 @@ class mwmbl{
foreach($results as $result){
$this->fuckhtml->load($result);
$this->heckhtml->load($result);
$p =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("p");
$out["web"][] = [
"title" =>
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"title",
$p
@ -129,9 +129,9 @@ class mwmbl{
),
"description" =>
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"extract",
$p
@ -139,9 +139,9 @@ class mwmbl{
)
),
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("a")
[0]
["attributes"]

View file

@ -419,7 +419,7 @@ class qwant{
"thumb" =>
$answer["data"]["result"]["thumbnail"]["landscape"] == null ?
null :
$this->unshitimage(
$this->fiximagethingie(
$answer["data"]["result"]["thumbnail"]["landscape"],
false
),
@ -470,7 +470,7 @@ class qwant{
if(isset($result["thumbnailUrl"])){
$thumb = [
"url" => $this->unshitimage($result["thumbnailUrl"]),
"url" => $this->fiximagethingie($result["thumbnailUrl"]),
"ratio" => "16:9"
];
}else{
@ -531,7 +531,7 @@ class qwant{
"height" => (int)$image["height"]
],
[
"url" => $this->unshitimage($image["thumbnail"]),
"url" => $this->fiximagethingie($image["thumbnail"]),
"width" => $image["thumb_width"],
"height" => $image["thumb_height"]
]
@ -557,7 +557,7 @@ class qwant{
"ratio" => null,
] :
[
"url" => $this->unshitimage($video["thumbnail"]),
"url" => $this->fiximagethingie($video["thumbnail"]),
"ratio" => "16:9",
],
"url" => $video["url"]
@ -692,7 +692,7 @@ class qwant{
"height" => $image["height"]
],
[
"url" => $this->unshitimage($image["thumbnail"]),
"url" => $this->fiximagethingie($image["thumbnail"]),
"width" => $image["thumb_width"],
"height" => $image["thumb_height"]
]
@ -785,7 +785,7 @@ class qwant{
}else{
$thumb = [
"url" => $this->unshitimage($video["thumbnail"], false),
"url" => $this->fiximagethingie($video["thumbnail"], false),
"ratio" => "16:9"
];
}
@ -888,7 +888,7 @@ class qwant{
}else{
$thumb = [
"url" => $this->unshitimage($news["media"][0]["pict_big"]["url"], false),
"url" => $this->fiximagethingie($news["media"][0]["pict_big"]["url"], false),
"ratio" => "16:9"
];
}
@ -916,7 +916,7 @@ class qwant{
return trim($text, ". ");
}
private function unshitimage($url, $is_bing = true){
private function fiximagethingie($url, $is_bing = true){
// https://s1.qwant.com/thumbr/0x0/8/d/f6de4deb2c2b12f55d8bdcaae576f9f62fd58a05ec0feeac117b354d1bf5c2/th.jpg?u=https%3A%2F%2Fwww.bing.com%2Fth%3Fid%3DOIP.vvDWsagzxjoKKP_rOqhwrQAAAA%26w%3D160%26h%3D160%26c%3D7%26pid%3D5.1&q=0&b=1&p=0&a=0
parse_str(parse_url($url)["query"], $parts);

View file

@ -11,8 +11,8 @@ class spotify{
include "lib/backend.php";
$this->backend = new backend("spotify");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
}
public function getfilters($page){
@ -205,10 +205,10 @@ class spotify{
}
// grep bearer and client ID
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$script =
$this->fuckhtml
$this->heckhtml
->getElementById(
"session",
"script"
@ -236,7 +236,7 @@ class spotify{
$this->get(
$ip,
"https://clienttoken.spotify.com/v1/clienttoken",
[ // !! that shit must be sent as json data
[
"client_data" => [
"client_id" => $client_id,
"client_version" => "1.2.27.93.g7aee53d4",

View file

@ -7,8 +7,8 @@ class yandex{
*/
public function __construct(){
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
include "lib/backend.php";
// backend included in the scraper functions
@ -312,11 +312,11 @@ class yandex{
"related" => []
];
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
// get nextpage
$npt =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"b-pager__next",
"a"
@ -326,7 +326,7 @@ class yandex{
$out["npt"] =
$this->backend->store(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$npt
[0]
@ -340,7 +340,7 @@ class yandex{
// get items
$items =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"b-serp-item",
"li"
@ -348,10 +348,10 @@ class yandex{
foreach($items as $item){
$this->fuckhtml->load($item);
$this->heckhtml->load($item);
$link =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"b-serp-item__title-link",
"a"
@ -360,16 +360,16 @@ class yandex{
$out["web"][] = [
"title" =>
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$link
)
),
"description" =>
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"b-serp-item__text",
"div"
@ -377,7 +377,7 @@ class yandex{
)
),
"url" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$link
["attributes"]
@ -654,7 +654,7 @@ class yandex{
$json["type"] == "captcha"
){
throw new Exception("Yandex blocked this 4get instance. Please try again in ~7 minutes.");
throw new Exception("Yandex blocked this NarviSearch instance. Please try again in ~7 minutes.");
}
$out = [
@ -694,13 +694,13 @@ class yandex{
}
}
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
// get search results
$data = null;
foreach(
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"Root",
"div"
@ -710,7 +710,7 @@ class yandex{
if(isset($div["attributes"]["data-state"])){
$tmp = json_decode(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$div["attributes"]["data-state"]
),
@ -741,7 +741,7 @@ class yandex{
$tmp = [
"title" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->titledots(
implode(": ", $title)
@ -928,7 +928,7 @@ class yandex{
if(!isset($json["blocks"])){
throw new Exception("Yandex blocked this 4get instance. Please try again in 7~ minutes.");
throw new Exception("Yandex blocked this NarviSearch instance. Please try again in 7~ minutes.");
}
$out = [
@ -950,17 +950,17 @@ class yandex{
}
}
$this->fuckhtml->load($html);
$this->heckhtml->load($html);
$div =
$this->fuckhtml
$this->heckhtml
->getElementsByTagName("div");
/*
Get nextpage
*/
$npt =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"more more_direction_next i-bem",
$div
@ -979,7 +979,7 @@ class yandex{
}
$items =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"serp-item",
$div
@ -989,17 +989,17 @@ class yandex{
$data =
json_decode(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$item["attributes"]["data-video"]
),
true
);
$this->fuckhtml->load($item);
$this->heckhtml->load($item);
$thumb =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"thumb-image__image",
"img"
@ -1019,7 +1019,7 @@ class yandex{
str_replace(
"//",
"https://",
$this->fuckhtml
$this->heckhtml
->getTextContent(
$thumb
[0]
@ -1033,7 +1033,7 @@ class yandex{
}
$smallinfos =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"serp-item__sitelinks-item",
"div"
@ -1052,7 +1052,7 @@ class yandex{
}
$info =
$this->fuckhtml
$this->heckhtml
->getTextContent(
$info
);
@ -1067,7 +1067,7 @@ class yandex{
}
$description =
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"serp-item__text serp-item__text_visibleText_always",
"div"
@ -1080,7 +1080,7 @@ class yandex{
$description =
$this->titledots(
$this->fuckhtml
$this->heckhtml
->getTextContent(
$description[0]
)
@ -1089,7 +1089,7 @@ class yandex{
$out["video"][] = [
"title" =>
$this->fuckhtml
$this->heckhtml
->getTextContent(
$this->titledots(
$data["title"]
@ -1114,7 +1114,7 @@ class yandex{
str_replace(
"http://",
"https://",
$this->fuckhtml
$this->heckhtml
->getTextContent(
$data["counters"]
["toHostingLoaded"]

View file

@ -7,8 +7,8 @@ class yep{
include "lib/backend.php";
$this->backend = new backend("yep");
include "lib/fuckhtml.php";
$this->fuckhtml = new fuckhtml();
include "lib/heckhtml.php";
$this->heckhtml = new heckhtml();
}
public function getfilters($page){
@ -437,7 +437,7 @@ class yep{
"thumb" =>
isset($news["img"]) ?
[
"url" => $this->unshiturl($news["img"]),
"url" => $this->fixURLthingie($news["img"]),
"ratio" => "16:9"
] :
[
@ -666,7 +666,7 @@ class yep{
"thumb" =>
isset($item["img"]) ?
[
"url" => $this->unshiturl($item["img"]),
"url" => $this->fixURLthingie($item["img"]),
"ratio" => "16:9"
] :
[
@ -685,11 +685,11 @@ class yep{
private function detect_cf($payload){
// detect cloudflare page
$this->fuckhtml->load($payload);
$this->heckhtml->load($payload);
if(
count(
$this->fuckhtml
$this->heckhtml
->getElementsByClassName(
"cf-wrapper",
"div"
@ -717,7 +717,7 @@ class yep{
return trim($title);
}
private function unshiturl($url){
private function fixURLthingie($url){
$newurl = parse_url($url, PHP_URL_QUERY);
parse_str($newurl, $newurl);

View file

@ -398,6 +398,7 @@ echo
);
$left =
'<a style="color: white" href="/"> ◄ Go back</a>' .
'<h1>Settings</h1>' .
'<form method="post" autocomplete="off">' .
'By clicking <div class="code-inline">Update settings!</div>, a plaintext <div class="code-inline">key=value</div> cookie will be stored on your browser. When selecting a default setting, the parameter is removed from your cookies.';
@ -477,7 +478,6 @@ $left .=
'</div>' .
'<div class="settings-submit">' .
'<input type="submit" value="Update settings!">' .
'<a href="../">&lt; Go back</a>' .
'</div>' .
'</form>';

View file

@ -191,7 +191,7 @@ async function fetch_server(server){
try{
var payload = await fetch(server + "/ami4get");
var payload = await fetch(server + "/amins");
if(payload.status !== 200){
@ -225,7 +225,7 @@ async function fetch_server(server){
)
) ||
typeof data.service != "string" ||
data.service != "4get" ||
data.service != "narvisearch" ||
(
typeof data.server.description != "string" &&
data.server.description !== null
@ -419,53 +419,6 @@ popup_bg.addEventListener("click", function(){
popup_bg.style.display = "none";
});
function show_server(serverid){
var html =
'<h2>' + htmlspecialchars(pinged_list[serverid].server.name) + '</h2>' +
'Description' +
'<div class="code">' + htmlspecialchars(pinged_list[serverid].server.description) + '</div>';
var url_obj = new URL(pinged_list[serverid].server.ip);
var url = htmlspecialchars(url_obj.origin);
var domain = url_obj.hostname;
html +=
'URL: <a rel="noreferer" target="_BLANK" href="' + url + redir + '">' + url + '</a> <a rel="noreferer" target="_BLANK" href="https://browserleaks.com/ip/' + encodeURIComponent(domain) + '">(IP lookup)</a>' +
'<br><br>Alt addresses:';
var len = pinged_list[serverid].server.alt_addresses.length;
if(len === 0){
html += ' <i>&lt;Empty&gt;</i>';
}else{
html += '<ul>';
for(var i=0; i<len; i++){
var url_obj = new URL(pinged_list[serverid].server.alt_addresses[i]);
var url = htmlspecialchars(url_obj.origin);
var domain = url_obj.hostname;
if(validate_url(pinged_list[serverid].server.alt_addresses[i], true)){
html += '<li><a rel="noreferer" href="' + url + redir + '" target="_BLANK">' + url + '</a> <a rel="noreferer" target="_BLANK" href="https://browserleaks.com/ip/' + encodeURIComponent(domain) + '">(IP lookup)</a></li>';
}else{
console.warn(pinged_list[serverid].server.ip + ": Invalid peer URL => " + pinged_list[serverid].server.alt_addresses[i]);
}
}
html += '</ul>';
}
popup.innerHTML = html;
popup_wrapper.style.display = "block";
popup_bg.style.display = "block";
}
function hide_server(){
popup_wrapper.style.display = "none";

View file

@ -7,8 +7,8 @@
/* font */
--928374: #928374;
--a89984: #a89984;
--bdae93: #bdae93;
--a89984: rgb(159, 159, 159);
--bdae93: white;
--8ec07c: #8ec07c;
--ebdbb2: #ebdbb2;
@ -41,42 +41,66 @@ body,html{
padding:0;
margin:0;
}
body{
background:var(--1d2021);
color:var(--a89984);
font-size:16px;
box-sizing:border-box;
font-family:sans-serif;
margin:15px 7% 45px;
word-wrap:anywhere;
line-height:22px;
max-width:2000px;
position:relative;
body {
background: black;
color: white;
font-family: arial;
max-width: 1200px;
margin: auto;
}
.navigation{
position:absolute;
top:0;
right:0;
font-size:14px;
line-height:40px;
.home-search {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 500px;
display: flex;
flex-direction: column;
align-items: center;
}
.home-search h1 {
color: white;
margin-bottom: 24px;
}
.searchbox input {
background: black;
color: white;
border: 1px #4a4a4a solid;
border-radius: 3rem;
padding: 6px 24px;
}
.searchbox input:focus {
outline: none;
background: #121212;
border-color: #676767;
}
.home-footer {
bottom: 24px;
position: absolute;
left: 50%;
transform: translate(-50%);
display: flex;
align-items: center;
gap: 24px;
}
.home-footer a {
color: white;
}
.navigation a{
color:var(--bdae93);
text-decoration:none;
.search-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24px 0px;
}
.navigation a:hover{
text-decoration:underline;
.search-header-start {
display: flex;
align-items: center;
gap: 24px;
}
.navigation a:not(:last-child)::after{
content:"|";
padding:0 7px;
display:inline-block;
color:var(--504945);
.search-header a {
color: white;
}
h1,h2,h3,h4,h5,h6{
@ -98,50 +122,6 @@ h3,h4,h5,h6{
}
/* Searchbox */
.searchbox{
width:40%;
height:36px;
border:1px solid var(--504945);
background:var(--282828);
border-radius:2px;
margin-bottom:10px;
position:relative;
}
.searchbox .wrapper{
overflow:hidden;
}
.searchbox input[type="text"]{
width:100%;
padding-left:10px;
}
.searchbox input[type="text"]::placeholder{
color:var(--928374);
}
.searchbox input[type="submit"]{
float:right;
cursor:pointer;
padding:0 10px;
}
.searchbox input[type="submit"]:hover{
text-decoration:underline;
}
.searchbox input{
all:unset;
line-height:36px;
box-sizing:border-box;
height:36px;
color:var(--bdae93);
}
.searchbox:focus-within{
border:1px solid var(--928374);
}
.autocomplete{
display:none;
@ -196,7 +176,9 @@ h3,h4,h5,h6{
}
.tabs .tab.selected{
border-bottom:2px solid var(--bdae93);
background: white;
color: black !important;
border-radius: 3rem;
}
/* Filters */
@ -221,7 +203,7 @@ h3,h4,h5,h6{
user-select:none;
display:block;
border:1px solid var(--504945);
border-radius:2px;
border-radius:3rem;
font-size:14px;
padding:0 4px;
width:127px;

View file

@ -2,7 +2,7 @@
<h1>Set as default search engine</h1>
<a href="#firefox"><h2 id="firefox">On Firefox and other Gecko based browsers</h2></a>
To set this as your default search engine on Firefox, right click the URL bar and select <div class="code-inline">Add "4get"</div>. Then, visit <a href="about:preferences#search" target="_BLANK" class="link">about:preferences#search</a> and select <div class="code-inline">4get</div> in the dropdown menu.
To set this as your default search engine on Firefox, right click the URL bar and select <div class="code-inline">Add "NarviSearch"</div>. Then, visit <a href="about:preferences#search" target="_BLANK" class="link">about:preferences#search</a> and select <div class="code-inline">NarviSearch</div> in the dropdown menu.
<a href="#chrome"><h2 id="chrome">On Chromium and Blink based browsers</h2></a>
Click the 3 superpositioned dots at the top right of the screen and click on <div class="code-inline">Settings</div>, then search for <div class="code-inline">default search engine</div>, or visit <a href="chrome://settings/searchEngines">chrome://settings/searchEngines</a>.<br><br>
@ -24,7 +24,7 @@ Once you're there, click the pencil on the last entry under "Search engines" (it
</tr>
<tr>
<td>URL with %s in place of query</td>
<td>https://4get.ca/web?s=%s</td>
<td>https://{%server_name%}/web?s=%s</td>
</tr>
</table>
@ -32,7 +32,7 @@ Once that's done, click <div class="code-inline">Save</div>. Then, on the right
<h1>Frequently asked questions</h1>
<a href="#what-is-this"><h2 id="what-is-this">What is this?</h2></a>
This is a metasearch engine that gets results from other engines, and strips away all of the tracking parameters and Microsoft/globohomo bullshit they add. Most of the other alternatives to Google jack themselves off about being ""privacy respecting"" or whatever the fuck but it always turns out to be a total lie, and I just got fed up with their shit honestly. Alternatives like Searx or YaCy all fucking sucks so I made my own thing.
This is a metasearch engine that gets results from other engines, and strips away all of the tracking parameters and Microsoft/globohomo stuff they add. Most of the other alternatives to Google jack themselves off about being ""privacy respecting"" or whatever the heck but it always turns out to be a total lie, and I just got fed up with their crap honestly. Alternatives like Searx or YaCy all hecking sucks so I made my own thing.
<a href="#goal"><h2 id="goal">My goal</h2></a>
Provide users with a privacy oriented, extremely lightweight, ad free, free as in freedom (and free beer!) way to search for documents around the internet, with minimal, optional javascript code. My long term goal would be to build my own index (that doesn't suck) and provide users with an unbiased search engine, with no political inclinations.
@ -43,13 +43,10 @@ I store data temporarly to get the next page of results. This might include sear
I <b>don't</b> log IP addresses, user agents, or anything else. The <div class="code-inline">npt</div> tokens are the only thing that are stored (in RAM, mind you), temporarly, encrypted.
<a href="#information-sharing"><h2 id="information-sharing">Do you share information with third parties?</h2></a>
Your search queries and supplied filters are shared with the scraper you chose (so I can get the search results, duh). I don't share anything else (that means I don't share your IP address, location, or anything of this kind). There is no way that site can know you're the one searching for something, <u>unless you send out a search query that de-anonymises you.</u> For example, a search query like "hello my full legal name is jonathan gallindo and i want pictures of cloacas" would definitively blow your cover. 4get doesn't contain ads or any third party javascript applets or trackers. I don't profile you, and quite frankly, I don't give a shit about what you search on there.<br><br>
Your search queries and supplied filters are shared with the scraper you chose (so I can get the search results, duh). I don't share anything else (that means I don't share your IP address, location, or anything of this kind). There is no way that site can know you're the one searching for something, <u>unless you send out a search query that de-anonymises you.</u> For example, a search query like "hello my full legal name is jonathan gallindo and i want pictures of cloacas" would definitively blow your cover. NarviSearch doesn't contain ads or any third party javascript applets or trackers. I don't profile you, and quite frankly, I don't give a heck about what you search on there.<br><br>
TL;DR assume those websites can see what you search for, but can't see who you are (unless you're really dumb).
<a href="#hosting"><h2 id="hosting">Where is this website hosted?</h2></a>
Please head over to the <a href="/instances">4get instances</a> page, select an instance and click on "IP lookup".
<a href="#keyboard-shortcuts"><h2 id="keyboard-shortcuts">Keyboard shortcuts?</h2></a>
Use <div class="code-inline">/</div> to focus the search box.<br><br>
@ -59,19 +56,9 @@ When the image viewer is open, you can use the following keybinds:<br>
<div class="code-inline">Escape</div> to exit the image viewer.
<a href="#schizo"><h2 id="schizo">How can I trust you?</h2></a>
You just sort of have to take my word for it right now. If you'd rather trust yourself instead of me (I believe in you!!), all of the code on this website is available trough my <a href="https://git.lolcat.ca/lolcat" class="link">git page</a> for you to host on your own machines. Just a reminder: if you're the sole user of your instance, it doesn't take immense brain power for Microshit to figure out you basically just switched IP addresses. Invite your friends to use your instance!
<a href="#donate"><h2 id="donate">Support the project</h2></a>
Donate to me trough ko-fi: <a href="https://ko-fi.com/lolcat" target="BLANK" rel="noreferrer">ko-fi.com/lolcat</a><br>
Please donate I sent myself a donation for testing if it works and it looks fucking dumb. Reasons to donate are listed on there. Thank you!
You just sort of have to take my word for it right now. If you'd rather trust yourself instead of me (I believe in you!!), all of the code on this website is available trough my <a href="hhttps://ark.sudovanilla.org/Korbs/NarviSearch" class="link">git page</a> for you to host on your own machines. Just a reminder: if you're the sole user of your instance, it doesn't take immense brain power for Microsoft to figure out you basically just switched IP addresses. Invite your friends to use your instance!
<a href="#contact"><h2 id="contact">I want to report abuse or have erotic roleplay trough email</h2></a>
I don't know about that second part but if you want to talk to me, just drop me an email...<br><br>
<b>Message to all DMCA enforcers:</b> I don't host any of the content. Everything you see here is <u>proxied</u> trough my shitbox with no moderation. Please reach out to the people hosting the infringing content instead.<br><br>
<a href="https://lolcat.ca" rel="dofollow" class="link">Click here to contact me!</a><br><br>
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2F4get.ca" title="W3 Valid!">
<img src="/static/icon/w3html.png" alt="Valid W3C HTML 4.01" width="88" height="31">
</a>
<b>Message to all DMCA enforcers:</b> I don't host any of the content. Everything you see here is <u>proxied</u> trough my with no moderation. Please reach out to the people hosting the infringing content instead.<br><br>

View file

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>{%title%}</title>
<link title="{%server_name%}" href="/opensearch{%ac%}" rel="search" type="application/opensearchdescription+xml">
@ -10,21 +11,24 @@
<meta name="robots" content="{%index%}index,{%index%}follow">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<meta name="description" content="{%server_name%}: {%description%}">
</head>
<body>
<div class="navigation">
<a href="/">Home</a>
<a href="/settings">Settings</a>
<a href="https://git.lolcat.ca/lolcat/4get_news" target="_BLANK">News</a>
</div>
</head>
<body>
<form method="GET" autocomplete="off">
<div class="search-header">
<div class="search-header-start">
<h2><a style="text-decoration: none;" href="/">NarviSearch</a></h2>
<div class="searchbox">
<input type="submit" value="Search" tabindex="-1">
<div class="wrapper">
<input type="text" value="{%search%}" maxlength="500" name="s" placeholder="Proxy search..." required>
</div>
<div class="autocomplete"></div>
</div>
</div>
<div class="search-header-end">
<a href="/settings">Settings</a>
</div>
</div>
<div class="tabs">
{%tabs%}
</div>

View file

@ -12,26 +12,26 @@
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<meta name="description" content="{%server_name%}: {%server_short_description%}">
</head>
<body class="home">
<div id="center">
<body>
<div class="home">
<div class="home-search">
<h1>NarviSearch</h1>
<form method="GET" autocomplete="off" action="web">
<div class="logo">
<a href="/">
<img src="{%banner%}" alt="4get">
</a>
</div>
<div class="searchbox">
<input type="submit" value="Search" tabindex="-1">
<div class="wrapper">
<input type="text" maxlength="500" name="s" placeholder="Proxy search..." required autofocus>
<input type="text" maxlength="500" name="s" placeholder="Start searching the web..." required autofocus>
</div>
<div class="autocomplete"></div>
</div>
</form>
<a href="settings">Settings</a><a href="instances">Instances</a><a href="https://git.lolcat.ca/lolcat/4get_news">News</a><a href="api.txt">API</a><a href="about">About</a><a href="https://git.lolcat.ca/lolcat/4get">Source</a><a href="https://ko-fi.com/lolcat" rel="noreferrer" target="BLANK">Donate</a>
<div class="subtext">
<a href="https://4get.ca">Clearnet</a><a href="http://4getwebfrq5zr4sxugk6htxvawqehxtdgjrbcn2oslllcol2vepa23yd.onion">Tor</a><a href="https://lolcat.ca">Report a problem</a><br>
Running on <b>v{%version%}</b>!!
</div>
<div class="home-footer">
<p>v1</p>
<a href="/about">About</a>
<a href="/api.txt">API</a>
<a href="https://status.sudovanilla.org/">Status</a>
<a href="https://ark.sudovanilla.org/Korbs/Search" target="_blank">Source</a>
<a href="/settings">Settings</a>
</div>
</div>
<script src="/static/client.js?v{%version%}"></script>

View file

@ -13,7 +13,7 @@
</head>
<body class="instances">
<h1>Instance browser</h1>
Learn how to setup your own instance here! <a href="https://git.lolcat.ca/lolcat/4get" target="_BLANK">https://git.lolcat.ca/lolcat/4get</a>
Learn how to setup your own instance here! <a href="https://ark.sudovanilla.org/Korbs/NarviSearch" target="_BLANK">https://ark.sudovanilla.org/Korbs/NarviSearch</a>
<noscript>
<div class="quote">For a better experience, whitelist javascript usage on this page.</div>
<table>

View file

@ -1,7 +1,7 @@
<?php
/*
Initialize random shit
Initialize random stuff
*/
include "data/config.php";

View file

@ -1,7 +1,7 @@
<?php
/*
Initialize random shit
Initialize random stuff
*/
include "data/config.php";