From c8c3ad82a54dcaf84850b713e296306071c61f98 Mon Sep 17 00:00:00 2001 From: jjanzen Date: Sat, 8 Mar 2025 16:35:01 -0600 Subject: system changes --- macos.local/flake/home/scripts/yt-to-rss.py | 12 ++++++++++++ macos.local/flake/home/scripts/yt-to-rss.py.org | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 macos.local/flake/home/scripts/yt-to-rss.py create mode 100644 macos.local/flake/home/scripts/yt-to-rss.py.org (limited to 'macos.local/flake/home/scripts') diff --git a/macos.local/flake/home/scripts/yt-to-rss.py b/macos.local/flake/home/scripts/yt-to-rss.py new file mode 100644 index 0000000..c442fb3 --- /dev/null +++ b/macos.local/flake/home/scripts/yt-to-rss.py @@ -0,0 +1,12 @@ +import requests +from bs4 import BeautifulSoup +import sys + +channel_link = sys.argv[1] + +response = requests.get(channel_link) +soup = BeautifulSoup(response.content, "html.parser") +rss_link = soup.find("link", title="RSS") +rss_url = rss_link.get("href") + +print(rss_url) diff --git a/macos.local/flake/home/scripts/yt-to-rss.py.org b/macos.local/flake/home/scripts/yt-to-rss.py.org new file mode 100644 index 0000000..619c6dd --- /dev/null +++ b/macos.local/flake/home/scripts/yt-to-rss.py.org @@ -0,0 +1,19 @@ +#+title: YouTube Channel to RSS Link + +Quick script to get the RSS link for a YouTube channel so I don't have to visit the website. + +#+begin_src python + import requests + from bs4 import BeautifulSoup + import sys + + channel_link = sys.argv[1] + + response = requests.get(channel_link) + soup = BeautifulSoup(response.content, "html.parser") + rss_link = soup.find("link", title="RSS") + rss_url = rss_link.get("href") + + print(rss_url) + +#+end_src -- cgit v1.2.3