✨Change name to AlpineFind & some enhancements
This commit is contained in:
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
# Copier le code source
|
||||||
|
COPY . /var/www/html/
|
||||||
|
|
||||||
|
# Installer les dépendances via Composer
|
||||||
|
RUN composer install --no-interaction --optimize-autoloader
|
||||||
|
|
||||||
|
# Ajuster les permissions
|
||||||
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
|
|
||||||
|
# Exposer le port 80
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Démarrer Apache
|
||||||
|
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.
|
||||||
|
|||||||
20
about.php
20
about.php
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
<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">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
a {
|
a {
|
||||||
@@ -23,24 +23,26 @@
|
|||||||
|
|
||||||
<form action="/" method="get">
|
<form action="/" method="get">
|
||||||
<a href="/">
|
<a href="/">
|
||||||
<font size=6 color="#008000">Frog</font>
|
<font size=6 color="#008000">Alpine</font>
|
||||||
<font size=6 color="#000000">Find!</font>
|
<font size=6 color="#000000">Find!</font>
|
||||||
</a> Leap again: <input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
</a>
|
||||||
|
<p>Leap again:</p>
|
||||||
|
<input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
||||||
<input type="submit" value="Ribbbit!">
|
<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>
|
||||||
|
|||||||
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
alpinefind:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "7000:80"
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html
|
||||||
|
restart: unless-stopped
|
||||||
@@ -30,7 +30,7 @@ if (substr($url, 0, 4) != "http") {
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>FrogFind Image Viewer</title>
|
<title>AlpineFind Image Viewer</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +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);
|
||||||
}
|
}
|
||||||
|
|||||||
58
index.php
58
index.php
@@ -9,6 +9,12 @@ 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;
|
||||||
|
|
||||||
|
// 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([
|
$context = stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Cache-Control: no-cache\r\n" .
|
'header' => "Cache-Control: no-cache\r\n" .
|
||||||
@@ -27,8 +33,16 @@ if (isset($_GET['q'])) { // if there's a search query, show the results for it
|
|||||||
$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);
|
||||||
@@ -47,6 +61,17 @@ if (isset($_GET['q'])) { // if there's a search query, show the results for it
|
|||||||
. $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
|
||||||
@@ -69,7 +94,7 @@ function clean_str($str)
|
|||||||
<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">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
a {
|
a {
|
||||||
@@ -98,6 +123,12 @@ function clean_str($str)
|
|||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function showLoading() {
|
||||||
|
document.getElementById('loading').style.display = 'inline';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="margin: 5px; padding: 0;">
|
<body style="margin: 5px; padding: 0;">
|
||||||
@@ -105,14 +136,19 @@ function clean_str($str)
|
|||||||
<?php if ($show_results) { // there's a search query in q, so show search results
|
<?php if ($show_results) { // there's a search query in q, so show search results
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="/" method="get" class="search-form">
|
<form action="/" method="get" onsubmit="return showLoading();" class="search-form">
|
||||||
<a href="/">
|
<a href="/">
|
||||||
<font size=6 color="#008000">Frog</font>
|
<font size=6 color="#008000">Alpine</font>
|
||||||
<font size=6 color="#000000">Find!</font>
|
<font size=6 color="#000000">Find!</font>
|
||||||
</a>
|
</a>
|
||||||
<div style="margin: 8px 0;">Leap again: <br>
|
<div style="margin: 8px 0;">
|
||||||
|
<p>Leap again:</p>
|
||||||
<input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
<input type="text" size="30" name="q" value="<?php echo urldecode($query) ?>">
|
||||||
|
<?php if (isset($_GET['p'])) { ?>
|
||||||
|
<input type="hidden" name="p" value="1">
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
<span id="loading" style="display: none;">Loading...</span>
|
||||||
<input type="submit" value="Ribbbit!">
|
<input type="submit" value="Ribbbit!">
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
@@ -127,7 +163,7 @@ function clean_str($str)
|
|||||||
<center>
|
<center>
|
||||||
<h1>
|
<h1>
|
||||||
<font size=7>
|
<font size=7>
|
||||||
<font color="#008000">Frog</font>Find!
|
<font color="#008000">Alpine</font>Find!
|
||||||
</font>
|
</font>
|
||||||
</h1>
|
</h1>
|
||||||
</center>
|
</center>
|
||||||
@@ -136,9 +172,10 @@ function clean_str($str)
|
|||||||
</center>
|
</center>
|
||||||
<br><br>
|
<br><br>
|
||||||
<center>
|
<center>
|
||||||
<form action="/" method="get">
|
<form action="/" method="get" onsubmit="return showLoading();">
|
||||||
Leap to: <br>
|
<p>Leap to:</p>
|
||||||
<input type="text" size="30" name="q"><br>
|
<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;">
|
<input type="submit" value="Ribbbit!" style="margin: 10px auto;">
|
||||||
</form>
|
</form>
|
||||||
</center>
|
</center>
|
||||||
@@ -150,9 +187,6 @@ function clean_str($str)
|
|||||||
</small>
|
</small>
|
||||||
</form>
|
</form>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
2
read.php
2
read.php
@@ -147,7 +147,7 @@ function clean_str($str)
|
|||||||
<p>
|
<p>
|
||||||
<form action="/read.php" method="get">
|
<form action="/read.php" method="get">
|
||||||
<a href="/">Back to <b>
|
<a href="/">Back to <b>
|
||||||
<font color="#008000">Frog</font>
|
<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 ?>">
|
<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>
|
||||||
|
|||||||
Reference in New Issue
Block a user