commit 16afe9c5b0a7d317c3c2d2806051e97192c414b5
parent c049fef177c4aa72ccad1e26fbd39c664562de42
Author: regexghost <dev@regexghost.com>
Date: Tue, 16 Jun 2026 20:54:17 +0100
added reddit rss fetcher, and livestream checker
Diffstat:
3 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/dotfiles/.config/newsraft/reddit-refresh.sh b/dotfiles/.config/newsraft/reddit-refresh.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+USER_AGENT="NetSurf/3.10 (Linux)"
+TMP_LOC="/tmp/reddit-rss"
+
+[ -d "$XDG_CACHE_HOME/reddit-rss" ] && cp "$XDG_CACHE_HOME/reddit-rss" "$TMP_LOC" || mkdir "$TMP_LOC"
+
+while true; do
+ while read -r subreddit; do
+ sleep 20
+ curl -s -L --user-agent "$USER_AGENT" "https://www.reddit.com/r/${subreddit}/top/.rss?t=week" > "${TMP_LOC}/r.${subreddit}"
+ done < "$XDG_CONFIG_HOME/newsraft/reddit-rss.txt"
+ sleep 3600
+done
diff --git a/terminal-scripts/Makefile b/terminal-scripts/Makefile
@@ -22,3 +22,4 @@ normal:
cp am-extract.sh ${BIN}/am-extract
cp yt-data.sh ${BIN}/yt-data
cp tag-music.py ${TERMINAL}/tag-music.py
+ cp stream-check.sh ${BIN}/stream-check
diff --git a/terminal-scripts/stream-check.sh b/terminal-scripts/stream-check.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+CONFIG_FILE="$XDG_CONFIG_HOME/regexghost/streams.csv"
+
+line="$(grep "^${1}," "$CONFIG_FILE")"
+[ "$line" = "" ] && exit
+
+name="$(echo "$line" | cut -d "," -f 1)"
+twitch_at="$(echo "$line" | cut -d "," -f 2)"
+youtube_at="$(echo "$line" | cut -d "," -f 3)"
+kick_at="$(echo "$line" | cut -d "," -f 4)"
+
+if ! [ "$twitch_at" = "NONE" ]; then
+ curl -s "https://www.twitch.tv/${twitch_at}" > /tmp/live_twitch.html
+ if grep -q "live_user" /tmp/live_twitch.html; then
+ echo "${name} is live on Twitch: https://www.twitch.tv/${twitch_at}"
+ fi
+fi
+if ! [ "$youtube_at" = "NONE" ]; then
+ curl -s "https://www.youtube.com/${youtube_at}/live" > /tmp/live_youtube.html
+ if grep -q "isLive\":true" /tmp/live_youtube.html; then
+ echo "${name} is live on YouTube: https://www.youtube.com/${youtube_at}/live"
+ fi
+fi
+if ! [ "$kick_at" = "NONE" ]; then
+ curl -s --user-agent "NetSurf" "https://kick.com/api/v1/channels/${kick_at}" > /tmp/live_kick.html
+ if grep -q "is_live\":true" /tmp/live_kick.html; then
+ echo "${name} is live on Kick: https://www.kick.com/${kick_at}"
+ fi
+fi