commit 2e885e9c6b204e6b8515bc51eabc94c9f382079f
parent 01c3d4c8e3875b0b520399bd5034820a177b0f19
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Fri, 10 May 2024 21:17:53 +0200
Format logs correctly
Diffstat:
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/reload.php b/reload.php
@@ -2,14 +2,18 @@
SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de>
-->
-<?php
-
- passthru("Rscript ./yt.R", $log);
-
-?>
<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="/assets/css/stylesheet.css"/>
<meta http-equiv="Refresh" content="0; url='/'" />
-<script>
- console.log(<?php implode("\n", $log); ?>);
-</script>
+</head>
+<body class="list dark">
+ <details>
+ <summary>Logs</summary>
+ <pre>
+<?php passthru("Rscript ./yt.R"); ?>
+ </pre>
+ </details>
+</body>
</html>
diff --git a/yt.R b/yt.R
@@ -61,7 +61,7 @@ for (i in seq_along(channels)) {
channel <- channels[i]
- cat(paste("Fetching:", as.character(channel)))
+ cat(paste("Fetching:", as.character(channel), " "))
video_dat <- NULL
video_dat <- tryCatch(fetch.yt(channel), error = function(e) NULL)