aboutsummaryrefslogtreecommitdiff
path: root/macos.local
diff options
context:
space:
mode:
Diffstat (limited to 'macos.local')
-rw-r--r--macos.local/flake/home/programs/core.nix.org1
-rw-r--r--macos.local/flake/home/scripts/yt-to-rss.py12
-rw-r--r--macos.local/flake/home/scripts/yt-to-rss.py.org19
3 files changed, 32 insertions, 0 deletions
diff --git a/macos.local/flake/home/programs/core.nix.org b/macos.local/flake/home/programs/core.nix.org
index 24b2555..8dd635a 100644
--- a/macos.local/flake/home/programs/core.nix.org
+++ b/macos.local/flake/home/programs/core.nix.org
@@ -51,6 +51,7 @@ Import configurations for programs and install programs with no configuration.
python312Packages.black
python312Packages.pylint
python312Packages.python-lsp-server
+ python312Packages.requests
ripgrep
rsync
rustup
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