lots of changes, cleaned up the PHP code

This commit is contained in:
root 2024-12-29 17:38:56 +01:00
parent 02a68bd648
commit def88e90f5
8 changed files with 173 additions and 407 deletions

View file

@ -1,29 +0,0 @@
DONE:
- install php8.2-fpm nginx
- make the nginx config
create index.php
- in it, you must be able to display the contents of the csv file in an array https://stackoverflow.com/questions/1269562/how-to-create-an-array-from-a-csv-file-using-php-and-the-fgetcsv-function
- create the status.csv file with this syntax: [URL;NAME;CATEGORY;DESCRIPTION;STATUS;]
- csv file updater in python ? and triggered by a cronjob ?
https://docs.python.org/3/library/csv.html
https://stackoverflow.com/questions/1949318/checking-if-a-website-is-up-via-python
https://stackoverflow.com/questions/63970912/urllib-request-with-socks5-proxy
-from python, sort the CSV files based on the score value
-make the css to be dark background and light text (copy it from nowhere)
-make a header php page, containing the links ot the other status pages
-make a monero node checker page,
-make a nowhere dot moe service checker
-upload the sourcecode to gitea
-> create README.md
TODO:
-> mention the sourcecode in the header
- check for status 200s otherwise it might believe that a 502 is a valid status code
-

View file

@ -5,3 +5,70 @@
<p><u>Update Frequency:</u> every 3 hours</p> </br>
<img src="img/onion.png">
<?php
function DisplayCSV($csvfile) {
$row = 1;
echo "<center><table>\n\n"; //begin html table formatting
if (($handle = fopen($csvfile, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
//echo "<p>" . $data[1] . "</p>";
//echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
//echo $row;
if ( $row == "2") {
echo "<tr><td>Name</td> <td>Score</td> <td></td></tr>";
}else{
for ($c=0; $c < $num; $c++) {
echo "<tr>"; // beging html table row
// if the row is the first one (name url status score) only display (Name Status Score):
// display the contents of a csv row
if ( $c == "1" ){
echo "<td>" . '<a href="'; // begin the table cell and a href
echo $data[$c] . '">'; // display the link
echo $data[0] . "</a></td><td>"; // display the link title and close the a href and first cell, open the second cell
echo $data[3] . "</td><td>"; // display the status and close the second cell, open the third cell
echo $data[2] . "</td> \n"; // display the score and close the third cell
}
//if ($c == 2){
//}
}
}
echo "</tr>"; // end html table row
}
echo "\n</table></center>";
fclose($handle);
}
}
function DisplayCSVold($csvfile) {
echo "<center><table>\n\n";
// Open a file
$file = fopen($csvfile, "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
}
?>

View file

@ -22,83 +22,24 @@ require("header.php");
<?php
require("webring.php");
?>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/webring.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?> </br>
<main>
<section class="container">
<div class="column">
<h3>Onion Webring Instances</h3>
<?php DisplayCSV("links/webring.csv");?>
</div>
<div class="column">
<h3>Infos and Indexes</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/Infos_and_indexes.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?> </br>
<?php DisplayCSV("links/Infos_and_indexes.csv");?>
</div>
<div class="column">
<h3>Search Engines</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/Search_Engines.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php DisplayCSV("links/Search_Engines.csv");?>
</div>
</section>
</main>
</center>
</body>

View file

@ -14,36 +14,20 @@
<?php
require("header.php");
?>
<h1>Onion Uptime Checker (WIP)</h1>
<h2>Monero Nodes (Last update: September 2024)</h3>
<p><u>Update Frequency:</u> every 3 hours</p>
<main>
<section class="container">
<div class="column">
<h3>Monero Nodes</h3>
<?php DisplayCSVold("links/MoneroNodes.csv");?>
</div>
</section>
</main>
<h3>Monero Nodes</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/MoneroNodes.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php
require("webring.php");

View file

@ -19,139 +19,37 @@ require("header.php");
<p>These are <b>non-sensitive services</b> that you can use anonymously (meaning that there are no KYC procedures to use those services). The below links were originally taken from the awesome <a href="kycnotmezdiftahfmc34pqbpicxlnx3jbf5p7jypge7gdvduu7i6qjqd.onion">kycnot.me</a>. I recommend accessing those services via Tor [<a href="http://blog.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/opsec/whonixqemuvms/index.html">1</a>] (including accessing VPSes via SSH via Tor aswell [<a href="http://blog.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/opsec/anonymousremoteserver/index.html">2</a>]), and to pay for them using monero [<a href="http://blog.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/opsec/monero2024/index.html">3</a>]. </p>
<p>(This page is strictly for educational purposes, we don't own any of the services below.)</p>
<main>
<section class="container">
<h2>Exchanges</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/kycnotme_exchanges.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<div class="column">
<h3>Exchanges</h3>
<?php DisplayCSV("links/kycnotme_exchanges.csv");?>
</div>
<div class="column">
<h3>SMS</h3>
<?php DisplayCSV("links/kycnotme_sms.csv");?>
</div>
<div class="column">
<h3>VPNs</h3>
<?php DisplayCSV("links/kycnotme_vpns.csv");?>
</div>
<div class="column">
<h3>VPS</h3>
<?php DisplayCSV("links/kycnotme_vps.csv");?>
</div>
<h2>SMS</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/kycnotme_sms.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<div class="column">
<h3>Other</h3>
<?php DisplayCSV("links/kycnotme_other.csv");?>
</div>
<h2>VPNs</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/kycnotme_vpns.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<h2>VPS</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/kycnotme_vps.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<h2>Other</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/kycnotme_other.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
</section>
</main>
<?php
require("webring.php");

View file

@ -14,36 +14,21 @@
<?php
require("header.php");
?>
<h1>Onion Uptime Checker (WIP)</h1>
<h3>Nowhere Infrastructure (last update: December 2024)</h3>
<p><u>Update Frequency:</u> every 3 hours</p>
<main>
<section class="container">
<div class="column">
<h3>Nowhere Services</h3>
<?php DisplayCSV("links/Nowhere.csv");?>
</div>
</section>
</main>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/Nowhere.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php
require("webring.php");
?>

View file

@ -21,141 +21,39 @@ require("header.php");
<p>(This page is strictly for educational puposes, we do not own any of the services below)</p>
<main>
<section class="container">
<div class="column">
<h3>Markets</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/Markets.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php DisplayCSV("links/Markets.csv");?>
</div>
<div class="column">
<h3>Exchanges</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/Exchanges.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php DisplayCSV("links/Exchanges.csv");?>
</div>
<div class="column">
<h3>Forums and Imageboards</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/Forums_and_Imageboards.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php DisplayCSV("links/Forums_and_Imageboards.csv");?>
</div>
<div class="column">
<h3>News</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/News.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php DisplayCSV("links/News.csv");?>
</div>
<div class="column">
<h3>Dead Markets</h3>
<?php
echo "<center><table>\n\n";
// Open a file
$file = fopen("links/Dead_Markets.csv", "r");
// Fetching data from csv file row by row
while (($data = fgetcsv($file)) !== false) {
// HTML tag for placing in row format
echo "<tr>";
foreach ($data as $i) {
echo "<td>" . htmlspecialchars($i)
. "</td>";
}
echo "</tr> \n";
}
// Closing the file
fclose($file);
echo "\n</table></center>";
?>
<?php DisplayCSV("links/Dead_Markets.csv");?>
</div>
</section>
</main>
<?php
require("webring.php");
?>

View file

@ -31,6 +31,9 @@ body{
flex-direction: column;
align-items: left;
justify-content: left;
margin: 0;
padding: 1rem;
}
.onion{
@ -136,21 +139,41 @@ body{
justify-content: center;*/
}
.container{
.container {
display: flex;
flex-wrap: wrap;
gap: 1rem;
}
/*.container{
display: flex;
flex-direction: row;
/*align-items: center;*/
padding: 2px 5px 2px 2px;
justify-content: left;
}
}*/
.column{
/*.column{
display: flex;
flex-direction: column;
padding: 5px 10px 5px 5px;
font-size: 18px;
}*/
.column {
padding: 1rem;
border-radius: 8px;
/*background-color: hsl(240, 62%, 90%);*/
flex: 1;
}
@media (max-width: 1024px) {
.column {
/*width: 100%;*/
flex: auto;
}
}
.column:nth-child(1){
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
@ -211,14 +234,13 @@ img{
filter: invert(1);
}
@media screen and (max-width: 1000px) {
/*@media screen and (max-width: 1000px) {
.container{
display: flex;
flex-direction: column;
/*align-items: center;*/
padding: 2px 5px 2px 2px;
justify-content: left;
}
}
}*/