Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35ec8c6fed | ||
|
|
4c187e4059 | ||
|
|
ca0fa5b815 | ||
|
|
dd78fcafd9 |
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
FROM arm64v8/php:8.1-apache
|
||||||
|
|
||||||
|
# Installation des dépendances PHP nécessaires
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
git \
|
||||||
|
unzip \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
|
# Activer le module rewrite pour Apache
|
||||||
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
|
# Installer Composer
|
||||||
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
# Définir le répertoire de travail
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# Exposer le port 80
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Script d'initialisation pour exécuter composer install et démarrer Apache
|
||||||
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
|
CMD ["apache2-foreground"]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# FrogFind
|
# AlpineFind
|
||||||
Source for the FrogFind search engine for vintage computers
|
Source for the AlpineFind search engine for vintage computers
|
||||||
|
|
||||||
Love the frog. Be the frog.
|
Love the Alpine. Be the Alpine.
|
||||||
|
|||||||
41
about.php
41
about.php
@@ -4,30 +4,47 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
<html>
|
|
||||||
<head>
|
<head>
|
||||||
<title>FrogFind!</title>
|
<title>AlpineFind!</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<style type="text/css">
|
||||||
|
a {
|
||||||
|
padding: 4px 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
|
<body style="margin: 5px; padding: 0;">
|
||||||
|
|
||||||
<form action="/" method="get">
|
<form action="/" method="get">
|
||||||
<a href="/"><font size=6 color="#008000">Frog</font><font size=6 color="#000000">Find!</font></a> Leap again: <input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
<a href="/">
|
||||||
<input type="submit" value="Ribbbit!">
|
<font size=6 color="#008000">Alpine</font>
|
||||||
|
<font size=6 color="#000000">Find!</font>
|
||||||
|
</a>
|
||||||
|
<p>Leap again:</p>
|
||||||
|
<input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
||||||
|
<input type="submit" value="Ribbbit!">
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
<br>
|
<br>
|
||||||
<center>
|
<center>
|
||||||
<h1>What in the world is FrogFind?</h1>
|
<h1>What in the world is AlpineFind?</h1>
|
||||||
<small>A quick FAQ on an unconventional search engine</small>
|
<small>A quick FAQ on an unconventional search engine</small>
|
||||||
</center>
|
</center>
|
||||||
<br>
|
<br>
|
||||||
<h3>Who made FrogFind?</h3>
|
<h3>Who made AlpineFind?</h3>
|
||||||
Hi, I'm Sean, A.K.A. <a href="https://youtube.com/ActionRetro">Action Retro</a> on YouTube. I work on a lot of 80's and 90's Macs (and other vintage machines), and I really like to try and get them online. However, the modern internet is not kind to old machines, which generally cannot handle the complicated javascript, CSS, and encryption that modern sites have. However, they can browse basic websites just fine. So I decided to see how much of the internet I could turn into basic websites, so that old machines can browse the modern internet once again!
|
Hi, I'm Sean, A.K.A. <a href="https://youtube.com/ActionRetro">Action Retro</a> on YouTube. I work on a lot of 80's and 90's Macs (and other vintage machines), and I really like to try and get them online. However, the modern internet is not kind to old machines, which generally cannot handle the complicated javascript, CSS, and encryption that modern sites have. However, they can browse basic websites just fine. So I decided to see how much of the internet I could turn into basic websites, so that old machines can browse the modern internet once again!
|
||||||
<h3>How does FrogFind work?</h3>
|
<h3>How does AlpineFind work?</h3>
|
||||||
The search functionality of FrogFind is basically a custom wrapper for DuckDuckGo search, converting the results to extremely basic HTML that old browsers can read. When clicking through to pages from search results, those pages are processed through a <a href="https://github.com/fivefilters/readability.php" target="_blank">PHP port of Mozilla's Readability</a>, which is what powers Firefox's reader mode. I then further strip down the results to be as basic HTML as possible.
|
The search functionality of AlpineFind is basically a custom wrapper for DuckDuckGo search, converting the results to extremely basic HTML that old browsers can read. When clicking through to pages from search results, those pages are processed through a <a href="https://github.com/fivefilters/readability.php" target="_blank">PHP port of Mozilla's Readability</a>, which is what powers Firefox's reader mode. I then further strip down the results to be as basic HTML as possible.
|
||||||
<h3>What machines do you test FrogFind on?</h3>
|
<h3>What machines do you test AlpineFind on?</h3>
|
||||||
I designed FrogFind with classic Macs in mind, so I've been testing on my SE/30 to make sure it looks good in 1 bit color with a 512x384 resolution. Most of my testing has been on Netscape 1.1N and 2.0.2, as well as a few 68k Mac versions of iCab. FrogFind should also work great on any text-based web browser!
|
I designed AlpineFind with classic Macs in mind, so I've been testing on my SE/30 to make sure it looks good in 1 bit color with a 512x384 resolution. Most of my testing has been on Netscape 1.1N and 2.0.2, as well as a few 68k Mac versions of iCab. AlpineFind should also work great on any text-based web browser!
|
||||||
<h3>How can I get in touch with you?</h3>
|
<h3>How can I get in touch with you?</h3>
|
||||||
Send me an email! <a href="mailto:actionretro@pm.me">actionretro@pm.me</a>
|
Send me an email! <a href="mailto:actionretro@pm.me">actionretro@pm.me</a>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
237
composer.lock
generated
237
composer.lock
generated
@@ -8,30 +8,30 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "fivefilters/readability.php",
|
"name": "fivefilters/readability.php",
|
||||||
"version": "v3.1.6",
|
"version": "v3.3.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fivefilters/readability.php.git",
|
"url": "https://github.com/fivefilters/readability.php.git",
|
||||||
"reference": "a00d35cb5eb14a236ba42326da9ac52c8c9f80a1"
|
"reference": "2cd2d3d7b24d3df9cc1dcb8919451876c693d69b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fivefilters/readability.php/zipball/a00d35cb5eb14a236ba42326da9ac52c8c9f80a1",
|
"url": "https://api.github.com/repos/fivefilters/readability.php/zipball/2cd2d3d7b24d3df9cc1dcb8919451876c693d69b",
|
||||||
"reference": "a00d35cb5eb14a236ba42326da9ac52c8c9f80a1",
|
"reference": "2cd2d3d7b24d3df9cc1dcb8919451876c693d69b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
"league/uri": "~6.7.2",
|
"league/uri": "^7.0",
|
||||||
"masterminds/html5": "^2.0",
|
"masterminds/html5": "^2.0",
|
||||||
"php": ">=7.4.0",
|
"php": ">=8.1",
|
||||||
"psr/log": "^1.0 || ^2.0 || ^3.0"
|
"psr/log": "^1.0 || ^2.0 || ^3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"monolog/monolog": "^2.3",
|
"monolog/monolog": "^3.0",
|
||||||
"phpunit/phpunit": "^9"
|
"phpunit/phpunit": "^10.0 || ^11.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"monolog/monolog": "Allow logging debug information"
|
"monolog/monolog": "Allow logging debug information"
|
||||||
@@ -67,59 +67,50 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/fivefilters/readability.php/issues",
|
"issues": "https://github.com/fivefilters/readability.php/issues",
|
||||||
"source": "https://github.com/fivefilters/readability.php/tree/v3.1.6"
|
"source": "https://github.com/fivefilters/readability.php/tree/v3.3.2"
|
||||||
},
|
},
|
||||||
"time": "2023-06-15T18:06:49+00:00"
|
"time": "2025-03-07T18:17:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/uri",
|
"name": "league/uri",
|
||||||
"version": "6.7.2",
|
"version": "7.5.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/uri.git",
|
"url": "https://github.com/thephpleague/uri.git",
|
||||||
"reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06"
|
"reference": "81fb5145d2644324614cc532b28efd0215bda430"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/uri/zipball/d3b50812dd51f3fbf176344cc2981db03d10fe06",
|
"url": "https://api.github.com/repos/thephpleague/uri/zipball/81fb5145d2644324614cc532b28efd0215bda430",
|
||||||
"reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06",
|
"reference": "81fb5145d2644324614cc532b28efd0215bda430",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-json": "*",
|
"league/uri-interfaces": "^7.5",
|
||||||
"league/uri-interfaces": "^2.3",
|
"php": "^8.1"
|
||||||
"php": "^7.4 || ^8.0",
|
|
||||||
"psr/http-message": "^1.0"
|
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"league/uri-schemes": "^1.0"
|
"league/uri-schemes": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
|
||||||
"friendsofphp/php-cs-fixer": "^v3.3.2",
|
|
||||||
"nyholm/psr7": "^1.5",
|
|
||||||
"php-http/psr7-integration-tests": "^1.1",
|
|
||||||
"phpstan/phpstan": "^1.2.0",
|
|
||||||
"phpstan/phpstan-deprecation-rules": "^1.0",
|
|
||||||
"phpstan/phpstan-phpunit": "^1.0.0",
|
|
||||||
"phpstan/phpstan-strict-rules": "^1.1.0",
|
|
||||||
"phpunit/phpunit": "^9.5.10",
|
|
||||||
"psr/http-factory": "^1.0"
|
|
||||||
},
|
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-fileinfo": "Needed to create Data URI from a filepath",
|
"ext-bcmath": "to improve IPV4 host parsing",
|
||||||
"ext-intl": "Needed to improve host validation",
|
"ext-fileinfo": "to create Data URI from file contennts",
|
||||||
"league/uri-components": "Needed to easily manipulate URI objects",
|
"ext-gmp": "to improve IPV4 host parsing",
|
||||||
"psr/http-factory": "Needed to use the URI factory"
|
"ext-intl": "to handle IDN host with the best performance",
|
||||||
|
"jeremykendall/php-domain-parser": "to resolve Public Suffix and Top Level Domain",
|
||||||
|
"league/uri-components": "Needed to easily manipulate URI objects components",
|
||||||
|
"php-64bit": "to improve IPV4 host parsing",
|
||||||
|
"symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "6.x-dev"
|
"dev-master": "7.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"League\\Uri\\": "src"
|
"League\\Uri\\": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@@ -159,8 +150,8 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"docs": "https://uri.thephpleague.com",
|
"docs": "https://uri.thephpleague.com",
|
||||||
"forum": "https://thephpleague.slack.com",
|
"forum": "https://thephpleague.slack.com",
|
||||||
"issues": "https://github.com/thephpleague/uri/issues",
|
"issues": "https://github.com/thephpleague/uri-src/issues",
|
||||||
"source": "https://github.com/thephpleague/uri/tree/6.7.2"
|
"source": "https://github.com/thephpleague/uri/tree/7.5.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -168,46 +159,44 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-09-13T19:50:42+00:00"
|
"time": "2024-12-08T08:40:02+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/uri-interfaces",
|
"name": "league/uri-interfaces",
|
||||||
"version": "2.3.0",
|
"version": "7.5.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/uri-interfaces.git",
|
"url": "https://github.com/thephpleague/uri-interfaces.git",
|
||||||
"reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383"
|
"reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383",
|
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/08cfc6c4f3d811584fb09c37e2849e6a7f9b0742",
|
||||||
"reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383",
|
"reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-json": "*",
|
"ext-filter": "*",
|
||||||
"php": "^7.2 || ^8.0"
|
"php": "^8.1",
|
||||||
},
|
"psr/http-factory": "^1",
|
||||||
"require-dev": {
|
"psr/http-message": "^1.1 || ^2.0"
|
||||||
"friendsofphp/php-cs-fixer": "^2.19",
|
|
||||||
"phpstan/phpstan": "^0.12.90",
|
|
||||||
"phpstan/phpstan-phpunit": "^0.12.19",
|
|
||||||
"phpstan/phpstan-strict-rules": "^0.12.9",
|
|
||||||
"phpunit/phpunit": "^8.5.15 || ^9.5"
|
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-intl": "to use the IDNA feature",
|
"ext-bcmath": "to improve IPV4 host parsing",
|
||||||
"symfony/intl": "to use the IDNA feature via Symfony Polyfill"
|
"ext-gmp": "to improve IPV4 host parsing",
|
||||||
|
"ext-intl": "to handle IDN host with the best performance",
|
||||||
|
"php-64bit": "to improve IPV4 host parsing",
|
||||||
|
"symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "2.x-dev"
|
"dev-master": "7.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"League\\Uri\\": "src/"
|
"League\\Uri\\": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@@ -221,17 +210,32 @@
|
|||||||
"homepage": "https://nyamsprod.com"
|
"homepage": "https://nyamsprod.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interface for URI representation",
|
"description": "Common interfaces and classes for URI representation and interaction",
|
||||||
"homepage": "http://github.com/thephpleague/uri-interfaces",
|
"homepage": "https://uri.thephpleague.com",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"data-uri",
|
||||||
|
"file-uri",
|
||||||
|
"ftp",
|
||||||
|
"hostname",
|
||||||
|
"http",
|
||||||
|
"https",
|
||||||
|
"parse_str",
|
||||||
|
"parse_url",
|
||||||
|
"psr-7",
|
||||||
|
"query-string",
|
||||||
|
"querystring",
|
||||||
"rfc3986",
|
"rfc3986",
|
||||||
"rfc3987",
|
"rfc3987",
|
||||||
|
"rfc6570",
|
||||||
"uri",
|
"uri",
|
||||||
"url"
|
"url",
|
||||||
|
"ws"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/thephpleague/uri-interfaces/issues",
|
"docs": "https://uri.thephpleague.com",
|
||||||
"source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0"
|
"forum": "https://thephpleague.slack.com",
|
||||||
|
"issues": "https://github.com/thephpleague/uri-src/issues",
|
||||||
|
"source": "https://github.com/thephpleague/uri-interfaces/tree/7.5.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -239,20 +243,20 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-06-28T04:27:21+00:00"
|
"time": "2024-12-08T08:18:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "masterminds/html5",
|
"name": "masterminds/html5",
|
||||||
"version": "2.8.1",
|
"version": "2.9.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Masterminds/html5-php.git",
|
"url": "https://github.com/Masterminds/html5-php.git",
|
||||||
"reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf"
|
"reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f47dcf3c70c584de14f21143c55d9939631bc6cf",
|
"url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6",
|
||||||
"reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf",
|
"reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -260,7 +264,7 @@
|
|||||||
"php": ">=5.3.0"
|
"php": ">=5.3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
|
"phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
@@ -304,31 +308,32 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/Masterminds/html5-php/issues",
|
"issues": "https://github.com/Masterminds/html5-php/issues",
|
||||||
"source": "https://github.com/Masterminds/html5-php/tree/2.8.1"
|
"source": "https://github.com/Masterminds/html5-php/tree/2.9.0"
|
||||||
},
|
},
|
||||||
"time": "2023-05-10T11:58:31+00:00"
|
"time": "2024-03-31T07:05:07+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-message",
|
"name": "psr/http-factory",
|
||||||
"version": "1.1",
|
"version": "1.1.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-message.git",
|
"url": "https://github.com/php-fig/http-factory.git",
|
||||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
|
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
||||||
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
|
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.2 || ^8.0"
|
"php": ">=7.1",
|
||||||
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.1.x-dev"
|
"dev-master": "1.0.x-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -343,7 +348,61 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "http://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
|
||||||
|
"keywords": [
|
||||||
|
"factory",
|
||||||
|
"http",
|
||||||
|
"message",
|
||||||
|
"psr",
|
||||||
|
"psr-17",
|
||||||
|
"psr-7",
|
||||||
|
"request",
|
||||||
|
"response"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/php-fig/http-factory"
|
||||||
|
},
|
||||||
|
"time": "2024-04-15T12:06:14+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "psr/http-message",
|
||||||
|
"version": "2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-fig/http-message.git",
|
||||||
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
|
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2 || ^8.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.0.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Psr\\Http\\Message\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "PHP-FIG",
|
||||||
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Common interface for HTTP messages",
|
"description": "Common interface for HTTP messages",
|
||||||
@@ -357,22 +416,22 @@
|
|||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-message/tree/1.1"
|
"source": "https://github.com/php-fig/http-message/tree/2.0"
|
||||||
},
|
},
|
||||||
"time": "2023-04-04T09:50:52+00:00"
|
"time": "2023-04-04T09:54:51+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/log.git",
|
"url": "https://github.com/php-fig/log.git",
|
||||||
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
|
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
|
"url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
|
||||||
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
|
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -407,18 +466,18 @@
|
|||||||
"psr-3"
|
"psr-3"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/log/tree/3.0.0"
|
"source": "https://github.com/php-fig/log/tree/3.0.2"
|
||||||
},
|
},
|
||||||
"time": "2021-07-14T16:46:02+00:00"
|
"time": "2024-09-11T13:17:53+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": {},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": [],
|
"platform": {},
|
||||||
"platform-dev": [],
|
"platform-dev": {},
|
||||||
"plugin-api-version": "2.3.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|||||||
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
alpinefind:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "7000:80"
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- supabase_default
|
||||||
|
- default
|
||||||
|
|
||||||
|
networks:
|
||||||
|
supabase_default:
|
||||||
|
external: true
|
||||||
13
docker-entrypoint.sh
Normal file
13
docker-entrypoint.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Exécuter composer install si le répertoire vendor n'existe pas
|
||||||
|
if [ ! -d "vendor" ]; then
|
||||||
|
composer install --no-interaction --optimize-autoloader
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ajuster les permissions
|
||||||
|
chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
|
# Passer au processus principal
|
||||||
|
exec "$@"
|
||||||
60
image.php
60
image.php
@@ -1,41 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$url = "";
|
$url = "";
|
||||||
|
|
||||||
//get the image url
|
//get the image url
|
||||||
if (isset( $_GET['i'] ) ) {
|
if (isset($_GET['i'])) {
|
||||||
$url = $_GET[ 'i' ];
|
$url = $_GET['i'];
|
||||||
} else {
|
} else {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//we can only do jpg and png here
|
//we can only do jpg and png here
|
||||||
if (strpos($url, ".jpg") && strpos($url, ".jpeg") && strpos($url, ".png") != true ) {
|
if (strpos($url, ".jpg") && strpos($url, ".jpeg") && strpos($url, ".png") != true) {
|
||||||
echo strpos($url, ".jpg");
|
echo strpos($url, ".jpg");
|
||||||
echo "Unsupported file type :(";
|
echo "Unsupported file type :(";
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//image needs to start with http
|
//image needs to start with http
|
||||||
if (substr( $url, 0, 4 ) != "http") {
|
if (substr($url, 0, 4) != "http") {
|
||||||
echo("Image failed :(");
|
echo ("Image failed :(");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
<title>FrogFind Image Viewer</title>
|
<head>
|
||||||
</head>
|
<title>AlpineFind Image Viewer</title>
|
||||||
<body">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
<small><a href="<?php echo $_SERVER['HTTP_REFERER'] ?>">< Back to previous page</a></small>
|
</head>
|
||||||
|
|
||||||
|
<body style="margin: 5px; padding: 0;">
|
||||||
|
<small><a href="<?php echo $_SERVER['HTTP_REFERER'] ?>">
|
||||||
|
< Back to previous page</a></small>
|
||||||
<p><small><b>Viewing image:</b> <?php echo $url ?></small></p>
|
<p><small><b>Viewing image:</b> <?php echo $url ?></small></p>
|
||||||
<img src="/image_compressed.php?i=<?php echo $url; ?>">
|
<img src="/image_compressed.php?i=<?php echo $url; ?>">
|
||||||
<br><br>
|
<br><br>
|
||||||
<small><a href="<?php echo $_SERVER['HTTP_REFERER'] ?>">< Back to previous page</a></small>
|
<small><a href="<?php echo $_SERVER['HTTP_REFERER'] ?>">
|
||||||
</body>
|
< Back to previous page</a></small>
|
||||||
</html>
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -5,14 +5,14 @@ $filetype = "";
|
|||||||
$raw_image = NULL;
|
$raw_image = NULL;
|
||||||
|
|
||||||
//get the image url
|
//get the image url
|
||||||
if (isset( $_GET['i'] ) ) {
|
if (isset($_GET['i'])) {
|
||||||
$url = $_GET[ 'i' ];
|
$url = $_GET['i'];
|
||||||
} else {
|
} else {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//an image will start with http, anything else is sus
|
//an image will start with http, anything else is sus
|
||||||
if (substr( $url, 0, 4 ) != "http") {
|
if (substr($url, 0, 4) != "http") {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,11 +31,11 @@ $raw_imagex = imagesx($raw_image);
|
|||||||
$raw_imagey = imagesy($raw_image);
|
$raw_imagey = imagesy($raw_image);
|
||||||
|
|
||||||
if ($raw_imagex >= $raw_imagey) {
|
if ($raw_imagex >= $raw_imagey) {
|
||||||
$dest_imagex = 300;
|
$dest_imagex = 240; // Réduit de 300 à 240
|
||||||
$dest_imagey = intval(($raw_imagey / $raw_imagex) * $dest_imagex);
|
$dest_imagey = intval(($raw_imagey / $raw_imagex) * $dest_imagex);
|
||||||
} else {
|
} else {
|
||||||
$dest_imagey = 200;
|
$dest_imagey = 160; // Réduit de 200 à 160
|
||||||
$dest_imagex = intval(($raw_imagex / $raw_imagey) * $dest_imagey);
|
$dest_imagex = intval(($raw_imagex / $raw_imagey) * $dest_imagey);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dest_image = imagecreatetruecolor($dest_imagex, $dest_imagey);
|
$dest_image = imagecreatetruecolor($dest_imagex, $dest_imagey);
|
||||||
@@ -44,9 +44,9 @@ imagecopyresampled($dest_image, $raw_image, 0, 0, 0, 0, $dest_imagex, $dest_imag
|
|||||||
|
|
||||||
header('Content-type: image/' . $filetype);
|
header('Content-type: image/' . $filetype);
|
||||||
if ($filetype = "jpg") {
|
if ($filetype = "jpg") {
|
||||||
imagejpeg($dest_image,NULL,80); //80% quality
|
// Compression augmentée de 80% à 65%
|
||||||
|
imagejpeg($dest_image, NULL, 65);
|
||||||
} elseif ($filetype = "png") {
|
} elseif ($filetype = "png") {
|
||||||
imagepng($dest_image,NULL,8); //80% compression
|
// Compression augmentée de 8 à 9 (plus compressé)
|
||||||
|
imagepng($dest_image, NULL, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
187
index.php
187
index.php
@@ -5,29 +5,50 @@ $show_results = FALSE;
|
|||||||
$results_html = "";
|
$results_html = "";
|
||||||
$final_result_html = "<hr>";
|
$final_result_html = "<hr>";
|
||||||
|
|
||||||
if(isset( $_GET['q'])) { // if there's a search query, show the results for it
|
if (isset($_GET['q'])) { // if there's a search query, show the results for it
|
||||||
$query = urlencode($_GET["q"]);
|
$query = urlencode($_GET["q"]);
|
||||||
$show_results = TRUE;
|
$show_results = TRUE;
|
||||||
$search_url = "https://html.duckduckgo.com/html?q=" . $query;
|
$search_url = "https://html.duckduckgo.com/html?q=" . $query;
|
||||||
if(!$results_html = file_get_contents($search_url)) {
|
|
||||||
|
// Configuration de la pagination
|
||||||
|
$results_per_page = 5; // Nombre de résultats par page
|
||||||
|
$current_page = isset($_GET['p']) ? intval($_GET['p']) : 1;
|
||||||
|
if ($current_page < 1) $current_page = 1;
|
||||||
|
|
||||||
|
$context = stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "Cache-Control: no-cache\r\n" .
|
||||||
|
"Pragma: no-cache\r\n" .
|
||||||
|
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 2_0 like Mac OS X) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20\r\n"
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
if (!$results_html = file_get_contents($search_url, false, $context)) {
|
||||||
$error_text .= "Failed to get results, sorry :( <br>";
|
$error_text .= "Failed to get results, sorry :( <br>";
|
||||||
}
|
}
|
||||||
$simple_results=$results_html;
|
$simple_results = $results_html;
|
||||||
$simple_results = str_replace( 'strong>', 'b>', $simple_results ); //change <strong> to <b>
|
$simple_results = str_replace('strong>', 'b>', $simple_results); //change <strong> to <b>
|
||||||
$simple_results = str_replace( 'em>', 'i>', $simple_results ); //change <em> to <i>
|
$simple_results = str_replace('em>', 'i>', $simple_results); //change <em> to <i>
|
||||||
$simple_results = clean_str($simple_results);
|
$simple_results = clean_str($simple_results);
|
||||||
|
|
||||||
$result_blocks = explode('<h2 class="result__title">', $simple_results);
|
$result_blocks = explode('<h2 class="result__title">', $simple_results);
|
||||||
$total_results = count($result_blocks)-1;
|
$total_results = count($result_blocks) - 1;
|
||||||
|
|
||||||
for ($x = 1; $x <= $total_results; $x++) {
|
// Calcul des paramètres de pagination
|
||||||
if(strpos($result_blocks[$x], '<a class="badge--ad">')===false) { //only return non ads
|
$total_pages = ceil($total_results / $results_per_page);
|
||||||
|
if ($total_pages == 0) $total_pages = 1; // Éviter la division par zéro
|
||||||
|
|
||||||
|
$start_result = ($current_page - 1) * $results_per_page + 1;
|
||||||
|
$end_result = min($start_result + $results_per_page - 1, $total_results);
|
||||||
|
|
||||||
|
// Affichage des résultats pour la page actuelle seulement
|
||||||
|
for ($x = $start_result; $x <= $end_result; $x++) {
|
||||||
|
if ($x <= $total_results && strpos($result_blocks[$x], '<a class="badge--ad">') === false) { //only return non ads
|
||||||
// result link, redirected through our proxy
|
// result link, redirected through our proxy
|
||||||
$result_link = explode('class="result__a" href="', $result_blocks[$x])[1];
|
$result_link = explode('class="result__a" href="', $result_blocks[$x])[1];
|
||||||
$result_topline = explode('">', $result_link);
|
$result_topline = explode('">', $result_link);
|
||||||
$result_link = str_replace( '//duckduckgo.com/l/?uddg=', '/read.php?a=', $result_topline[0]);
|
$result_link = str_replace('//duckduckgo.com/l/?uddg=', '/read.php?a=', $result_topline[0]);
|
||||||
// result title
|
// result title
|
||||||
$result_title = str_replace("</a>","",explode("\n", $result_topline[1]));
|
$result_title = str_replace("</a>", "", explode("\n", $result_topline[1]));
|
||||||
// result display url
|
// result display url
|
||||||
$result_display_url = explode('class="result__url"', $result_blocks[$x])[1];
|
$result_display_url = explode('class="result__url"', $result_blocks[$x])[1];
|
||||||
$result_display_url = trim(explode("\n", $result_display_url)[1]);
|
$result_display_url = trim(explode("\n", $result_display_url)[1]);
|
||||||
@@ -37,19 +58,31 @@ if(isset( $_GET['q'])) { // if there's a search query, show the results for it
|
|||||||
$result_snippet = explode('</a>', $result_snippet)[0];
|
$result_snippet = explode('</a>', $result_snippet)[0];
|
||||||
|
|
||||||
$final_result_html .= "<br><a href='" . $result_link . "'><font size='4'><b>" . $result_title[0] . "</b></font><br><font color='#008000' size='2'>"
|
$final_result_html .= "<br><a href='" . $result_link . "'><font size='4'><b>" . $result_title[0] . "</b></font><br><font color='#008000' size='2'>"
|
||||||
. $result_display_url . "</font></a><br>" . $result_snippet . "<br><br><hr>";
|
. $result_display_url . "</font></a><br>" . $result_snippet . "<br><br><hr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ajout des liens de pagination
|
||||||
|
$final_result_html .= "<br><center>";
|
||||||
|
if ($current_page > 1) {
|
||||||
|
$final_result_html .= "<a href='/?q=" . $query . "&p=" . ($current_page - 1) . "'>< Previous</a> ";
|
||||||
|
}
|
||||||
|
$final_result_html .= "Page " . $current_page . " of " . $total_pages;
|
||||||
|
if ($current_page < $total_pages) {
|
||||||
|
$final_result_html .= " <a href='/?q=" . $query . "&p=" . ($current_page + 1) . "'>Next ></a>";
|
||||||
|
}
|
||||||
|
$final_result_html .= "</center>";
|
||||||
}
|
}
|
||||||
|
|
||||||
//replace chars that old machines probably can't handle
|
//replace chars that old machines probably can't handle
|
||||||
function clean_str($str) {
|
function clean_str($str)
|
||||||
$str = str_replace( "‘", "'", $str );
|
{
|
||||||
$str = str_replace( "’", "'", $str );
|
$str = str_replace("‘", "'", $str);
|
||||||
$str = str_replace( "“", '"', $str );
|
$str = str_replace("’", "'", $str);
|
||||||
$str = str_replace( "”", '"', $str );
|
$str = str_replace("“", '"', $str);
|
||||||
$str = str_replace( "–", '-', $str );
|
$str = str_replace("”", '"', $str);
|
||||||
$str = str_replace( "'", "'", $str );
|
$str = str_replace("–", '-', $str);
|
||||||
|
$str = str_replace("'", "'", $str);
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
@@ -59,39 +92,101 @@ function clean_str($str) {
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>FrogFind!</title>
|
<title>AlpineFind!</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<style type="text/css">
|
||||||
|
a {
|
||||||
|
padding: 4px 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"] {
|
||||||
|
font-size: 16px;
|
||||||
|
height: 24px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
width: 80%;
|
||||||
|
max-width: 280px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="submit"] {
|
||||||
|
font-size: 16px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 2px 12px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-form {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function showLoading() {
|
||||||
|
document.getElementById('loading').style.display = 'inline';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php if($show_results) { // there's a search query in q, so show search results ?>
|
<body style="margin: 5px; padding: 0;">
|
||||||
|
|
||||||
<form action="/" method="get">
|
<?php if ($show_results) { // there's a search query in q, so show search results
|
||||||
<a href="/"><font size=6 color="#008000">Frog</font><font size=6 color="#000000">Find!</font></a> Leap again: <input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
?>
|
||||||
<input type="submit" value="Ribbbit!">
|
|
||||||
</form>
|
|
||||||
<hr>
|
|
||||||
<br>
|
|
||||||
<center>Search Results for <b><?php echo strip_tags(urldecode($query)) ?></b></center>
|
|
||||||
<br>
|
|
||||||
<?php echo $final_result_html ?>
|
|
||||||
|
|
||||||
<?php } else { // no search query, so show new search ?>
|
<form action="/" method="get" onsubmit="return showLoading();" class="search-form">
|
||||||
<br><br><center><h1><font size=7><font color="#008000">Frog</font>Find!</font></h1></center>
|
<a href="/">
|
||||||
<center><h3>The Search Engine for Vintage Computers</h3></center>
|
<font size=6 color="#008000">Alpine</font>
|
||||||
<br><br>
|
<font size=6 color="#000000">Find!</font>
|
||||||
<center>
|
</a>
|
||||||
<form action="/" method="get">
|
<div style="margin: 8px 0;">
|
||||||
Leap to: <input type="text" size="30" name="q"><br>
|
<p>Leap again:</p>
|
||||||
<input type="submit" value="Ribbbit!">
|
<input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
||||||
</center>
|
<?php if (isset($_GET['p'])) { ?>
|
||||||
<br><br><br>
|
<input type="hidden" name="p" value="1">
|
||||||
<small><center>Built by <b><a href="https://youtube.com/ActionRetro">Action Retro</a></b> on YouTube | <a href="about.php">Why build such a thing?</a></center><br>
|
<?php } ?>
|
||||||
<small><center>Powered by DuckDuckGo</center></small>
|
</div>
|
||||||
</form>
|
<span id="loading" style="display: none;">Loading...</span>
|
||||||
</form>
|
<input type="submit" value="Ribbbit!">
|
||||||
|
</form>
|
||||||
<?php } ?>
|
<hr>
|
||||||
|
<br>
|
||||||
|
<center>Search Results for <b><?php echo strip_tags(urldecode($query)) ?></b></center>
|
||||||
|
<br>
|
||||||
|
<?php echo $final_result_html ?>
|
||||||
|
|
||||||
|
<?php } else { // no search query, so show new search
|
||||||
|
?>
|
||||||
|
<br><br>
|
||||||
|
<center>
|
||||||
|
<h1>
|
||||||
|
<font size=7>
|
||||||
|
<font color="#008000">Alpine</font>Find!
|
||||||
|
</font>
|
||||||
|
</h1>
|
||||||
|
</center>
|
||||||
|
<center>
|
||||||
|
<h3>The Search Engine for Vintage Computers</h3>
|
||||||
|
</center>
|
||||||
|
<br><br>
|
||||||
|
<center>
|
||||||
|
<form action="/" method="get" onsubmit="return showLoading();">
|
||||||
|
<p>Leap to:</p>
|
||||||
|
<input type="text" size="30" name="q"><br>
|
||||||
|
<span id="loading" style="display: none;">Loading...</span>
|
||||||
|
<input type="submit" value="Ribbbit!" style="margin: 10px auto;">
|
||||||
|
</form>
|
||||||
|
</center>
|
||||||
|
<br><br><br>
|
||||||
|
<small>
|
||||||
|
<center>Built by <b><a href="https://youtube.com/ActionRetro">Action Retro</a></b> on YouTube | <a href="about.php">Why build such a thing?</a></center><br>
|
||||||
|
<small>
|
||||||
|
<center>Powered by DuckDuckGo</center>
|
||||||
|
</small>
|
||||||
|
</form>
|
||||||
|
</form>
|
||||||
|
<?php } ?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
96
read.php
96
read.php
@@ -17,15 +17,15 @@ $compatible_content_types = [
|
|||||||
// a direct link to the file.
|
// a direct link to the file.
|
||||||
$proxy_download_max_filesize = 8000000; // ~ 8Mb
|
$proxy_download_max_filesize = 8000000; // ~ 8Mb
|
||||||
|
|
||||||
if( isset( $_GET['a'] ) ) {
|
if (isset($_GET['a'])) {
|
||||||
$article_url = $_GET["a"];
|
$article_url = $_GET["a"];
|
||||||
} else {
|
} else {
|
||||||
echo "What do you think you're doing... >:(";
|
echo "What do you think you're doing... >:(";
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (substr( $article_url, 0, 4 ) != "http") {
|
if (substr($article_url, 0, 4) != "http") {
|
||||||
echo("That's not a web page :(");
|
echo ("That's not a web page :(");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,8 +38,7 @@ $headers = get_headers($article_url, true, $context);
|
|||||||
|
|
||||||
if (!array_key_exists('Content-Type', $headers) || !array_key_exists('Content-Length', $headers)) {
|
if (!array_key_exists('Content-Type', $headers) || !array_key_exists('Content-Length', $headers)) {
|
||||||
$error_text .= "Failed to get the article, its server did not return expected details :( <br>";
|
$error_text .= "Failed to get the article, its server did not return expected details :( <br>";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Attempt to handle downloads or other mime-types by passing proxying them through.
|
// Attempt to handle downloads or other mime-types by passing proxying them through.
|
||||||
if (!in_array($headers['Content-Type'], $compatible_content_types)) {
|
if (!in_array($headers['Content-Type'], $compatible_content_types)) {
|
||||||
$filesize = $headers['Content-Length'];
|
$filesize = $headers['Content-Length'];
|
||||||
@@ -49,12 +48,11 @@ else {
|
|||||||
echo 'Failed to proxy file download, it\'s too large. :( <br>';
|
echo 'Failed to proxy file download, it\'s too large. :( <br>';
|
||||||
echo 'You can try downloading the file directly: ' . $article_url;
|
echo 'You can try downloading the file directly: ' . $article_url;
|
||||||
die();
|
die();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$contentType = $headers['Content-Type'];
|
$contentType = $headers['Content-Type'];
|
||||||
// Only use the last-provided content type if an array was returned (ie. when there were redirects involved)
|
// Only use the last-provided content type if an array was returned (ie. when there were redirects involved)
|
||||||
if (is_array($contentType)) {
|
if (is_array($contentType)) {
|
||||||
$contentType = $contentType[count($contentType)-1];
|
$contentType = $contentType[count($contentType) - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = basename($url['path']);
|
$filename = basename($url['path']);
|
||||||
@@ -68,7 +66,7 @@ else {
|
|||||||
header('Content-Type: ' . $contentType);
|
header('Content-Type: ' . $contentType);
|
||||||
header('Content-Length: ' . $filesize);
|
header('Content-Length: ' . $filesize);
|
||||||
// Set the content-disposition to encourage the browser to download the file.
|
// Set the content-disposition to encourage the browser to download the file.
|
||||||
header('Content-Disposition: attachment; filename="'. $filename . '"');
|
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||||
|
|
||||||
// Use readfile
|
// Use readfile
|
||||||
readfile($article_url);
|
readfile($article_url);
|
||||||
@@ -89,30 +87,31 @@ $configuration
|
|||||||
|
|
||||||
$readability = new Readability($configuration);
|
$readability = new Readability($configuration);
|
||||||
|
|
||||||
if(!$article_html = file_get_contents($article_url)) {
|
if (!$article_html = file_get_contents($article_url)) {
|
||||||
$error_text .= "Failed to get the article :( <br>";
|
$error_text .= "Failed to get the article :( <br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$readability->parse($article_html);
|
$readability->parse($article_html);
|
||||||
$readable_article = strip_tags($readability->getContent(), '<a><ol><ul><li><br><p><small><font><b><strong><i><em><blockquote><h1><h2><h3><h4><h5><h6>');
|
$readable_article = strip_tags($readability->getContent(), '<a><ol><ul><li><br><p><small><font><b><strong><i><em><blockquote><h1><h2><h3><h4><h5><h6>');
|
||||||
$readable_article = str_replace( 'strong>', 'b>', $readable_article ); //change <strong> to <b>
|
$readable_article = str_replace('strong>', 'b>', $readable_article); //change <strong> to <b>
|
||||||
$readable_article = str_replace( 'em>', 'i>', $readable_article ); //change <em> to <i>
|
$readable_article = str_replace('em>', 'i>', $readable_article); //change <em> to <i>
|
||||||
|
|
||||||
$readable_article = clean_str($readable_article);
|
$readable_article = clean_str($readable_article);
|
||||||
$readable_article = str_replace( 'href="http', 'href="/read.php?a=http', $readable_article ); //route links through proxy
|
$readable_article = str_replace('href="http', 'href="/read.php?a=http', $readable_article); //route links through proxy
|
||||||
|
|
||||||
} catch (ParseException $e) {
|
} catch (ParseException $e) {
|
||||||
$error_text .= 'Sorry! ' . $e->getMessage() . '<br>';
|
$error_text .= 'Sorry! ' . $e->getMessage() . '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//replace chars that old machines probably can't handle
|
//replace chars that old machines probably can't handle
|
||||||
function clean_str($str) {
|
function clean_str($str)
|
||||||
$str = str_replace( "‘", "'", $str );
|
{
|
||||||
$str = str_replace( "’", "'", $str );
|
$str = str_replace("‘", "'", $str);
|
||||||
$str = str_replace( "“", '"', $str );
|
$str = str_replace("’", "'", $str);
|
||||||
$str = str_replace( "”", '"', $str );
|
$str = str_replace("“", '"', $str);
|
||||||
$str = str_replace( "–", '-', $str );
|
$str = str_replace("”", '"', $str);
|
||||||
|
$str = str_replace("–", '-', $str);
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
@@ -120,19 +119,41 @@ function clean_str($str) {
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
<title><?php echo $readability->getTitle();?></title>
|
<head>
|
||||||
</head>
|
<title><?php echo $readability->getTitle(); ?></title>
|
||||||
<body>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<style type="text/css">
|
||||||
|
a {
|
||||||
|
padding: 4px 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="text"] {
|
||||||
|
font-size: 16px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="submit"] {
|
||||||
|
font-size: 16px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 2px 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body style="margin: 5px; padding: 0;">
|
||||||
<p>
|
<p>
|
||||||
<form action="/read.php" method="get">
|
<form action="/read.php" method="get">
|
||||||
<a href="/">Back to <b><font color="#008000">Frog</font><font color="000000">Find!</font></a></b> | Browsing URL: <input type="text" size="38" name="a" value="<?php echo $article_url ?>">
|
<a href="/">Back to <b>
|
||||||
|
<font color="#008000">Alpine</font>
|
||||||
|
<font color="000000">Find!</font></a></b> | Browsing URL: <input type="text" size="38" name="a" value="<?php echo $article_url ?>">
|
||||||
<input type="submit" value="Go!">
|
<input type="submit" value="Go!">
|
||||||
</form>
|
</form>
|
||||||
</p>
|
</p>
|
||||||
<hr>
|
<hr>
|
||||||
<h1><?php echo clean_str($readability->getTitle());?></h1>
|
<h1><?php echo clean_str($readability->getTitle()); ?></h1>
|
||||||
<p> <?php
|
<p> <?php
|
||||||
$img_num = 0;
|
$img_num = 0;
|
||||||
$imgline_html = "View page images:";
|
$imgline_html = "View page images:";
|
||||||
@@ -143,11 +164,16 @@ function clean_str($str) {
|
|||||||
$imgline_html .= " <a href='image.php?i=" . $image_url . "'>[$img_num]</a> ";
|
$imgline_html .= " <a href='image.php?i=" . $image_url . "'>[$img_num]</a> ";
|
||||||
}
|
}
|
||||||
endforeach;
|
endforeach;
|
||||||
if($img_num>0) {
|
if ($img_num > 0) {
|
||||||
echo $imgline_html ;
|
echo $imgline_html;
|
||||||
}
|
}
|
||||||
?></small></p>
|
?></small></p>
|
||||||
<?php if($error_text) { echo "<p><font color='red'>" . $error_text . "</font></p>"; } ?>
|
<?php if ($error_text) {
|
||||||
<p><font size="4"><?php echo $readable_article;?></font></p>
|
echo "<p><font color='red'>" . $error_text . "</font></p>";
|
||||||
</body>
|
} ?>
|
||||||
</html>
|
<p>
|
||||||
|
<font size="4"><?php echo $readable_article; ?></font>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user