commit 0c3f3351fffc1acdfeb2b65dfd36164c44052ca1
parent 4f6946ac60f2cb2bf968094cd7d14feb339ed34f
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Sun, 25 Oct 2026 09:38:30 +0100
feat: url ignore list
Diffstat:
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/ignore.json b/ignore.json
@@ -0,0 +1,6 @@
+{
+ "url": [
+ ".*sportschau.de\\/.*",
+ ".*\\/sport\\/.*"
+ ]
+}
diff --git a/index.tt b/index.tt
@@ -77,6 +77,9 @@
array_map('serialize', $news)
)
);
+
+ // Read ignore list (URLs)
+ $ignore_urls = json_decode(file_get_contents("./ignore.json"), true);
?>
@@ -91,12 +94,23 @@
if ($entry["content"] == "" || $entry["content"] == $entry["title"]) {
continue;
}
+
+ $ignore_url = 0;
+ foreach ($ignore_urls["url"] as $iv) {
+ $ignore_pattern = '/' . $iv . '/';
+ if (preg_match($ignore_pattern, $entry["url"])) {
+ $ignore_url++;
+ }
+ }
+ if ($ignore_url > 0) {
+ continue;
+ }
+
$counter++;
if ($counter > 20) {
continue;
}
-
$entry["content"] = preg_replace(
'/<[^>]+>/',
'',