diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..0a37a01 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "WebSearch" + ] + } +} diff --git a/.env.example b/.env.example index a831d1e..df063ed 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ DATABASE_URL=postgresql+asyncpg://reddit:changeme@localhost:5432/reddit_monitor REDDIT_USER_AGENT=reddit-monitor:v1.0 # Subreddits to auto-add on first worker startup (comma-separated) -SEED_SUBREDDITS= +SEED_SUBREDDITS=mechanicalkeyboards,mnk,CustomKeyboards,BudgetKeebs,mechmarket,olkb,switchmodders,ErgoMechKeyboards,QMK,zmk,keycaps,keycapdesigners,ArtisanMacro,40PercentClub,60PercentClub,Keychron,HHKB,ModelM,Topre,WootingKB,Glorious,DuckyKeyboard,colemak,dvorak,KeyboardLayouts,MechanicalKeyboardsUK,MechanicalKeyboardsEU,mkindia,keyboards,EnthusiastKeyboards # Daily digest generation hour (UTC, 0-23) DIGEST_HOUR_UTC=23 diff --git a/backend/worker/reddit_client.py b/backend/worker/reddit_client.py index 9b68b00..d4018ba 100644 --- a/backend/worker/reddit_client.py +++ b/backend/worker/reddit_client.py @@ -8,7 +8,7 @@ from backend.config import settings logger = logging.getLogger(__name__) -BASE_URL = "https://www.reddit.com" +BASE_URL = "https://old.reddit.com" # Simple in-process rate limiter: track request timestamps _request_times: list[float] = [] @@ -52,7 +52,11 @@ async def fetch_json(client: httpx.AsyncClient, path: str, params: dict | None = def create_client() -> httpx.AsyncClient: """Create an httpx client configured for Reddit.""" return httpx.AsyncClient( - headers={"User-Agent": settings.reddit_user_agent}, + headers={ + "User-Agent": settings.reddit_user_agent, + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "Accept-Language": "en-US,en;q=0.5", + }, timeout=30.0, follow_redirects=True, )