From 6debf4a0782b39a1fe351b93ae97ed34edbe59c5 Mon Sep 17 00:00:00 2001 From: Devathmaj Date: Wed, 23 Sep 2026 15:53:37 +0530 Subject: [PATCH 1/2] Priority tier changes for reddit --- Sources/Subreddit.txt | 8 +++++--- Sources/source.md | 2 +- voucherbot/database/bootstrap.py | 8 ++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Sources/Subreddit.txt b/Sources/Subreddit.txt index 9fa3ce6..439e9af 100644 --- a/Sources/Subreddit.txt +++ b/Sources/Subreddit.txt @@ -1,14 +1,15 @@ # Official Reddit sources (voucherbot/database/bootstrap.py) # Reddit OAuth API: REDDIT_INGESTION_ENABLED in .env (default false — RSS-only collection) +# Kodexis API fallback: KODEXIS_API_KEY in .env (used when OAuth disabled) # Fetch limit: 25 posts per poll -# Tier A — every 15 min +# Tier C — every 240 min (moved from Tier A) AWSCertifications AzureCertification Udemy FreeUdemyCoupons -# Tier B — every 60 min +# Tier D — every 720 min (moved from Tier B) O365Certification CompTIA ccna @@ -29,4 +30,5 @@ vmware # eFreebies # FREE # deals (disabled) -# freebies (disabled) \ No newline at end of file +# freebies (disabled) +# mcsa (removed) \ No newline at end of file diff --git a/Sources/source.md b/Sources/source.md index 721bd8d..6d31457 100644 --- a/Sources/source.md +++ b/Sources/source.md @@ -8,7 +8,7 @@ Collectors prefer RSS/APIs, identify as `VoucherBot`, obey `robots.txt` / Crawl- | File | Contents | |------|----------| -| [`Subreddit.txt`](Subreddit.txt) | Reddit subreddits (Tier A/B), plus disabled subs | +| [`Subreddit.txt`](Subreddit.txt) | Reddit subreddits (Tier C/D), plus disabled subs | | [`RSS_List.txt`](RSS_List.txt) | RSS, blog, and forum feeds | | [`Website_List.txt`](Website_List.txt) | HTML scrapers (vendor pages, aggregators) | | [`Event_List.txt`](Event_List.txt) | Vendor event listing pages | diff --git a/voucherbot/database/bootstrap.py b/voucherbot/database/bootstrap.py index ffb9ee2..587ec6f 100644 --- a/voucherbot/database/bootstrap.py +++ b/voucherbot/database/bootstrap.py @@ -136,13 +136,17 @@ def _warn_on_invalid_selectors(config: dict[str, Any], source_name: str) -> None # Removed from catalog — too noisy for cert-voucher signal. DISABLED_REDDIT_SUBREDDITS = {"deals", "freebies"} -TIER_A_REDDIT_SUBS = { +# Moved from Tier A to Tier C (15min -> 240min) +TIER_C_REDDIT_SUBS = { "AWSCertifications", "AzureCertification", "Udemy", "FreeUdemyCoupons", } +# Moved from Tier B to Tier D (60min -> 720min) +# All other HIGH_SIGNAL_REDDIT_SUBREDDITS not in TIER_C_REDDIT_SUBS + _TIER_CADENCE_MINUTES = { "A": 15, "B": 60, @@ -152,7 +156,7 @@ def _warn_on_invalid_selectors(config: dict[str, Any], source_name: str) -> None def _reddit_tier(sub: str) -> str: - return "A" if sub in TIER_A_REDDIT_SUBS else "B" + return "C" if sub in TIER_C_REDDIT_SUBS else "D" def _source_name(source_type: SourceType, label: str) -> str: From b816006ae60198cbf0184ffaeec9093f008a486a Mon Sep 17 00:00:00 2001 From: Devathmaj Date: Wed, 23 Sep 2026 15:56:46 +0530 Subject: [PATCH 2/2] Test suit change for tier modification --- tests/test_bootstrap.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index de453b1..71a2eef 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -29,11 +29,11 @@ class TestRedditTier: - def test_tier_a_subreddits(self) -> None: - assert bootstrap._reddit_tier("AWSCertifications") == "A" + def test_tier_c_subreddits(self) -> None: + assert bootstrap._reddit_tier("AWSCertifications") == "C" - def test_other_subreddits_are_tier_b(self) -> None: - assert bootstrap._reddit_tier("CompTIA") == "B" + def test_other_subreddits_are_tier_d(self) -> None: + assert bootstrap._reddit_tier("CompTIA") == "D" class TestSourceName: