remove youtube api portions

Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
This commit is contained in:
2025-09-14 19:29:25 -04:00
parent cdbeec0af3
commit 5fd6bb4ab7
7 changed files with 3 additions and 121 deletions

View File

@@ -1,53 +0,0 @@
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<title>
Floppy
</title>
<?php
$DESCRIPTION = "The great bun bun's videos. Floppy has many great videos.";
include 'include/all.php';
?>
</head>
<body>
<?php
include 'include/menu.php';
echo "<div class='main'>";
?>
<h1>Floppy Videos!</h1>
<?php
if (file_exists("floppy.json")) {
$youtubeInfo = file_get_contents("floppy.json");
$youtubeInfo = json_decode($youtubeInfo, true);
$newData = false;
if ($youtubeInfo["date"] + 3600 < time()) {
$newData = true;
}
} else {
$newData = true;
}
if ($newData) {
$youtubeKey = file_get_contents("config.json");
$youtubeKey = json_decode($youtubeKey, true)["api"];
$onlineFile = file_get_contents("https://www.googleapis.com/youtube/v3/search?part=id&channelId=UCUkQSe5Dk-ch8QjONDMXEpw&maxResults=50&order=date&key=$youtubeKey");
$youtubeInfo = json_decode($onlineFile, true);
$youtubeInfo["date"] = time();
$youtubeJson = json_encode($youtubeInfo);
$jsonFile = fopen("floppy.json", "w");
fwrite($jsonFile, $youtubeJson);
fclose($jsonFile);
}
foreach ($youtubeInfo["items"] as $link) {
if ($link["id"]["kind"] == "youtube#video") {
$ID = $link["id"]["videoId"];
echo "<iframe width='560' height='315' style='max-width:99%' src='https://www.youtube-nocookie.com/embed/$ID' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>";
}
}
?>
</div>
</body>
</html>

0
html/include/logic.php Normal file → Executable file
View File

View File

@@ -15,8 +15,6 @@
["Cookie Clicker Addon", "/cookieClicker/index.php"],
["Truth Trees", "/logic/index.php"],
["Random Stuff Generator", "/random_stuff/index.php"],
["Floppy", "/floppy.php"],
["Soccer", "/soccer.php"],
["Electricity Log", "/electricity.php"],
["privilege", "viewLog", "/log/index.php", "Server Log"],
["privilege", "viewBackup", "/backup/index.php", "Backups"],

View File

@@ -29,11 +29,9 @@ if (!file_exists("config.json")) {
If you find any bugs or want to request a feature feel free to open a github issue and I will look at it. If you find a security vulnerability or issue in my code please contact me directly at
<a href="mailto:security@lschaefer.xyz?subject=Website%20Vulnerability&amp;body=Hi%2C%20your%20website%20has%20a%20vulnerability.%20The%20vulnerability%20is%20...%20If%20you%20want%20to%20test%20it%20out%20these%20are%20the%20steps%20to%20reproduce%20it%20...%0AFrom%2C%20NAME">security@lschaefer.xyz</a>
</p>
<a href="/floppy.php">
<?php
createImage("floppy", "Picture of the great bun bun Floppy.");
?>
</a>
<?php
createImage("floppy", "Picture of the great bun bun Floppy.");
?>
</div>
</body>

View File

@@ -6,12 +6,6 @@
<loc>https://www.lschaefer.xyz/electricity.php</loc>
</url>
<url>
<loc>https://www.lschaefer.xyz/floppy.php</loc>
</url>
<url>
<loc>https://www.lschaefer.xyz/soccer.php</loc>
</url>
<url>
<loc>https://www.lschaefer.xyz/login.php</loc>
</url>
<url>

View File

@@ -1,54 +0,0 @@
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<title>
Soccer Videos
</title>
<?php
$DESCRIPTION = "Videos of playing soccer.";
include 'include/all.php';
?>
</head>
<body>
<?php
include 'include/menu.php';
echo "<div class='main'>";
?>
<h1>Soccer Videos!</h1>
<iframe width="560" style="max-width:99%" height="315" src="https://www.youtube-nocookie.com/embed/kPdi0NANkwg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<?php
if (file_exists("soccer.json")) {
$youtubeInfo = file_get_contents("soccer.json");
$youtubeInfo = json_decode($youtubeInfo, true);
$newData = false;
if ($youtubeInfo["date"] + 3600 < time()) {
$newData = true;
}
} else {
$newData = true;
}
if ($newData) {
$youtubeKey = file_get_contents("config.json");
$youtubeKey = json_decode($youtubeKey, true)["api"];
$onlineFile = file_get_contents("https://www.googleapis.com/youtube/v3/search?part=id&channelId=UC3yfjZGDJutrB0kSYpd9u-A&maxResults=50&order=date&key=$youtubeKey");
$youtubeInfo = json_decode($onlineFile, true);
$youtubeInfo["date"] = time();
$youtubeJson = json_encode($youtubeInfo);
$jsonFile = fopen("soccer.json", "w");
fwrite($jsonFile, $youtubeJson);
fclose($jsonFile);
}
foreach ($youtubeInfo["items"] as $link) {
if ($link["id"]["kind"] == "youtube#video") {
$ID = $link["id"]["videoId"];
echo "<iframe width='560' style='max-width:99%' height='315' src='https://www.youtube-nocookie.com/embed/$ID' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>";
}
}
?>
</div>
</body>
</html>

View File

@@ -62,7 +62,6 @@ try:
# This stores a list for the default config
envConfiguration = [
[["passwordOptions", "cost"], int(os.getenv("PASSWORD_ROUNDS", '10'))],
[["api"], os.getenv("WEBSITE_API")],
[["mail", "server"], os.getenv("MAIL_SMTP_SERVER", "smtp.sendgrid.net")],
[["mail", "username"], os.getenv("MAIL_USERNAME", "apikey")],
[["mail", "password"], os.getenv("MAIL_PASSWORD", "none")],