commit 9263974048af1ba31bc0127ac2149d8b63fd455f
parent 8662bd9a6b03d86f12a647e6f4b03d60baf4f0b1
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Mon, 29 Jul 2024 14:22:27 +0200
fix: show umlauts by decoding text for HTML
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/yt.R b/yt.R
@@ -6,7 +6,14 @@
setTimeLimit(elapsed = 300)
# Load Packages ----------------------------------------------------------------
-if (!require("tidyRSS")) { install.packages("tidyRSS"); library("tidyRSS") }
+if (!require("tidyRSS")) {
+ install.packages("tidyRSS")
+ library("tidyRSS")
+}
+if (!require("textutils")) {
+ install.packages("textutils")
+ library("textutils")
+}
# Load URLs --------------------------------------------------------------------
channels <- as.character(
@@ -82,6 +89,11 @@ for (i in seq_along(channels)) {
}
data <- do.call(rbind, video_dat)
+# encode text for ASCII compatibility
+for (i in seq_along(data)) {
+ data[, i] <- textutils::HTMLencode(data[, i])
+}
+
# edit data --------------------------------------------------------------------
# sorting according to date and time