Skip to content

Commit f0282ef

Browse files
sonlovinbotclaude
andcommitted
Box Xem lại Workshop Muse AI (hết 23:55 5/10) trên README và trang giới thiệu; Action tự gỡ quảng cáo README khi hết hạn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e7f4052 commit f0282ef

5 files changed

Lines changed: 69 additions & 0 deletions

File tree

‎.github/scripts/expire_ads.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""Gỡ các khối quảng cáo đã hết hạn khỏi README.md.
2+
3+
Khối có dạng:
4+
<!-- AD:START until=2026-10-05T23:55:00+07:00 -->
5+
...
6+
<!-- AD:END -->
7+
Quá thời điểm `until` thì xoá cả khối (kèm dòng trống ngay sau). In "changed" nếu có sửa.
8+
"""
9+
import re
10+
import sys
11+
from datetime import datetime, timezone
12+
from pathlib import Path
13+
14+
path = Path(sys.argv[1] if len(sys.argv) > 1 else "README.md")
15+
text = path.read_text(encoding="utf-8")
16+
now = datetime.now(timezone.utc)
17+
pattern = re.compile(r"<!-- AD:START until=(\S+) -->.*?<!-- AD:END -->\n?\n?", re.S)
18+
19+
20+
def drop(m: "re.Match[str]") -> str:
21+
try:
22+
until = datetime.fromisoformat(m.group(1))
23+
except ValueError:
24+
return m.group(0) # ngày sai định dạng: giữ nguyên, không xoá nhầm
25+
return "" if now >= until else m.group(0)
26+
27+
28+
new = pattern.sub(drop, text)
29+
if new != text:
30+
path.write_text(new, encoding="utf-8")
31+
print("changed")

‎.github/workflows/expire-ads.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Tự gỡ khối quảng cáo hết hạn trong README (đánh dấu bằng <!-- AD:START until=… --> … <!-- AD:END -->).
2+
# Chạy mỗi 15 phút; GitHub có thể trễ lịch vài phút tới cả giờ khi tải cao.
3+
name: Gỡ quảng cáo hết hạn
4+
on:
5+
schedule:
6+
- cron: "*/15 * * * *"
7+
workflow_dispatch:
8+
permissions:
9+
contents: write
10+
jobs:
11+
expire:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Gỡ khối hết hạn
16+
id: run
17+
run: echo "out=$(python3 .github/scripts/expire_ads.py README.md)" >> "$GITHUB_OUTPUT"
18+
- name: Commit nếu có thay đổi
19+
if: steps.run.outputs.out == 'changed'
20+
run: |
21+
git config user.name "github-actions[bot]"
22+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
23+
git commit -am "README: gỡ quảng cáo đã hết hạn"
24+
git push

‎README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ Skill dựng phim hoạt hình ngắn **từ đầu đến cuối trên Muse AI*
1414
> [!TIP]
1515
> Thấy skill có ích? Bấm **⭐ Star** ở góc trên repo — giúp nhiều người làm phim tìm thấy skill này hơn.
1616
17+
<!-- AD:START until=2026-10-05T23:55:00+07:00 -->
18+
> [!IMPORTANT]
19+
> **🎬 Xem lại Workshop Muse AI** — Record Zoom 4/10: tạo ảnh, video, audio miễn phí với Muse AI và làm giọng đọc bằng AI Audio Voice. **Chỉ mở đến 23:55 hôm nay (05/10/2026).**
20+
>
21+
> [![Xem lại Workshop Muse AI](docs/assets/ads/muse-record.jpg)](https://academy.coachio.ai/funnels/record-workshop-muse-ai?utm_source=github_readme&utm_medium=readme&utm_campaign=muse-workshop-record&utm_content=muse-skill-readme)
22+
>
23+
> 👉 **[Xem lại ngay](https://academy.coachio.ai/funnels/record-workshop-muse-ai?utm_source=github_readme&utm_medium=readme&utm_campaign=muse-workshop-record&utm_content=muse-skill-readme)** · <sub>Ad · Coachio Academy — khối này tự gỡ khi hết hạn</sub>
24+
<!-- AD:END -->
25+
1726
## 🎥 Video giới thiệu
1827

1928
[![Video giới thiệu Muse AI](docs/assets/video-thumbnail.jpg)](https://youtu.be/kysOeBo5Qtw)

‎docs/assets/ads/muse-record.jpg‎

81.1 KB
Loading

‎docs/index.html‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
.shot span small { color: var(--muted); }
7070
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
7171
.scenes { margin-top: 18px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
72+
.spk[data-sponsor-page] { margin-top: 48px; }
7273
.scene { display: grid; grid-template-columns: 54px 1.1fr 1.6fr; gap: 14px; padding: 14px 18px; background: var(--card); border-top: 1px solid var(--line); align-items: start; }
7374
.scene:first-child { border-top: 0; }
7475
.scene .n { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: rgba(246,125,28,.18); color: var(--gold); }
@@ -159,6 +160,9 @@ <h1>Làm phim hoạt hình ngắn<br><em>từ ý tưởng đến file MP4</em></
159160
<div class="hero-img"><img src="assets/poster.jpg" alt="Poster phim The Last Lantern — Ngọn Đèn Cuối Cùng" width="1280" height="720"></div>
160161
</header>
161162

163+
<!-- Quảng cáo có hạn: nội dung + ngày hết hạn ở app.danghuuson.com/sponsors/sponsors.json (trang "muse"); hết hạn tự ẩn -->
164+
<div data-sponsor-page="muse" data-theme="dark"></div>
165+
162166
<h2 id="video">🎥 Video giới thiệu</h2>
163167
<p class="sub">Muse AI — tạo ảnh, video, audio — có cảnh từ phim mẫu “The Last Lantern”.</p>
164168
<div class="video" id="yt" role="button" tabindex="0" aria-label="Phát video giới thiệu Muse AI">
@@ -277,5 +281,6 @@ <h2>Skill có ích với bạn?</h2>
277281
setTimeout(() => (b.textContent = "Sao chép"), 2000);
278282
}));
279283
</script>
284+
<script src="https://app.danghuuson.com/sponsors/sponsors.js" defer></script>
280285
</body>
281286
</html>

0 commit comments

Comments
 (0)