Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e09c363
Add GitHub Actions workflow to update YouTube section
owgydz May 28, 2026
3efa00d
Add script to update YouTube video embed in HTML
owgydz May 28, 2026
22a5850
Add the comments so the workflow works
owgydz May 28, 2026
1ae3947
Fix my idiotic self putting an indent in all lines
owgydz May 28, 2026
5e88d68
Re add the comment
owgydz May 28, 2026
ea4aee9
Change path to index.html in update_youtube.py
owgydz May 28, 2026
261174d
Implement error handling for YouTube markers
owgydz May 28, 2026
9b6b889
Fix file path for index.html in update_youtube.py
owgydz May 28, 2026
72af142
Add UTF-8 encoding to file operations in update_youtube.py
owgydz May 28, 2026
251179a
Fix comment formatting for YouTube section
owgydz May 28, 2026
8e50d85
chore: auto-update YouTube section
github-actions[bot] May 28, 2026
8bd1c50
chore: auto-update YouTube section
github-actions[bot] May 30, 2026
31b6196
chore: auto-update YouTube section
github-actions[bot] May 31, 2026
a6182d9
chore: auto-update YouTube section
github-actions[bot] May 31, 2026
4638b69
chore: auto-update YouTube section
github-actions[bot] Jun 1, 2026
6473c70
chore: auto-update YouTube section
github-actions[bot] Jun 2, 2026
c23f463
chore: auto-update YouTube section
github-actions[bot] Jun 3, 2026
7a75dfa
chore: auto-update YouTube section
github-actions[bot] Jun 3, 2026
789ff5e
chore: auto-update YouTube section
github-actions[bot] Jun 5, 2026
20dc4a9
chore: auto-update YouTube section
github-actions[bot] Jun 5, 2026
3354125
chore: auto-update YouTube section
github-actions[bot] Jun 13, 2026
4e66959
chore: auto-update YouTube section
github-actions[bot] Jun 15, 2026
5b3d936
chore: auto-update YouTube section
github-actions[bot] Jun 15, 2026
ec27afe
chore: auto-update YouTube section
github-actions[bot] Jun 19, 2026
40056d3
chore: auto-update YouTube section
github-actions[bot] Jun 20, 2026
ae059fc
chore: auto-update YouTube section
github-actions[bot] Jun 21, 2026
6c68107
chore: auto-update YouTube section
github-actions[bot] Jun 22, 2026
79ff7bc
chore: auto-update YouTube section
github-actions[bot] Jun 23, 2026
2df0e6f
chore: auto-update YouTube section
github-actions[bot] Jun 24, 2026
b193cb2
chore: auto-update YouTube section
github-actions[bot] Jun 25, 2026
c05edb9
chore: auto-update YouTube section
github-actions[bot] Jun 26, 2026
37d9aff
chore: auto-update YouTube section
github-actions[bot] Jun 26, 2026
f506c97
chore: auto-update YouTube section
github-actions[bot] Jun 27, 2026
08464fa
chore: auto-update YouTube section
github-actions[bot] Jun 28, 2026
31ec630
chore: auto-update YouTube section
github-actions[bot] Jun 29, 2026
9ff05e9
chore: auto-update YouTube section
github-actions[bot] Jun 30, 2026
06a42f1
chore: auto-update YouTube section
github-actions[bot] Jul 1, 2026
2e46615
chore: auto-update YouTube section
github-actions[bot] Jul 2, 2026
75ecc3b
chore: auto-update YouTube section
github-actions[bot] Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/scripts/update_youtube.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import urllib.request
import xml.etree.ElementTree as ET
import re

CHANNEL_ID = "UCM4Zvt9DVqzAHJOJoCgcF_g"
RSS_URL = f"https://www.youtube.com/feeds/videos.xml?channel_id={CHANNEL_ID}"

NS = {
"atom": "http://www.w3.org/2005/Atom",
"yt": "http://www.youtube.com/xml/schemas/2015",
}

with urllib.request.urlopen(RSS_URL) as r:
root = ET.fromstring(r.read())

entry = root.find("atom:entry", NS)
title = entry.find("atom:title", NS).text
video_id = entry.find("yt:videoId", NS).text
embed_url = f"https://www.youtube.com/embed/{video_id}"

block = (
"<!-- YOUTUBE-LATEST-START -->\n"
f" <p>7Zeb's Newest Video is: {title}</p>\n"
f" <h3>Watch it now!</h3>\n"
f' <iframe width="650" height="542" src="{embed_url}" title="{title}" frameborder="0" '
f'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" '
f'referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>\n'
" <!-- YOUTUBE-LATEST-END -->"
)

with open("index.html", "r", encoding="utf-8") as f:
content = f.read()

if "<!-- YOUTUBE-LATEST-START -->" not in content:
raise RuntimeError(
"Markers not found in index.html, add <!-- YOUTUBE-LATEST-START --> "
"and <!-- YOUTUBE-LATEST-END --> around the newest video block."
)

updated = re.sub(
r"<!-- YOUTUBE-LATEST-START -->.*?<!-- YOUTUBE-LATEST-END -->",
block,
content,
flags=re.DOTALL,
)

if updated == content:
print("No change.")
else:
with open("index.html", "w", encoding="utf-8") as f:
f.write(updated)

print(f"Updated: {title} ({video_id})")
24 changes: 24 additions & 0 deletions .github/workflows/update-youtube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update YouTube Section

on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Update YouTube section
run: python .github/scripts/update_youtube.py

- name: Commit and push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add index.html
git diff --staged --quiet || (git commit -m "chore: auto-update YouTube section" && git push)
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ <h1 style="color:#1fe079">Welcome to 7Zeb's Website</h1>
<!-- YouTube Section -->
<section class="glass" id="youtube">
<h2>Newest Video</h2>
<p>7Zeb's Newest Video is: Installing Windows Sun Valley on real hardware</p>
<!-- YOUTUBE-LATEST-START -->
<p>7Zeb's Newest Video is: “Picture Passwords and Wallpapers” - Exploring Windows 8 Build 7997 But things go mildly wrong</p>
<h3>Watch it now!</h3>
<iframe width="650" height="542" src="https://www.youtube.com/embed/peiEb-jPmMs" title="Installing Windows Sun Valley on real hardware" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<iframe width="650" height="542" src="https://www.youtube.com/embed/XHUxtXzzqhw" title="“Picture Passwords and Wallpapers” - Exploring Windows 8 Build 7997 But things go mildly wrong" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<!-- YOUTUBE-LATEST-END -->
<p>Currently 735 Subscribers (-1 Since Last Update)</p>
<p>Go to 7Zeb's Channel <a href="https://youtube.com/@7zeb"><button>Here</button></a></p>
<br>
Expand Down