Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daily.dev Auto Reader 📖

Auto-read articles from daily.dev using Playwright with cookie-based authentication, with Telegram notifications and reading-streak tracking.

Features

  • ✅ Reads 2-4 random articles per run
  • Skips promoted/ad articles (detects "Promoted" label)
  • Human-like reading simulation (scrolling, random pauses)
  • ✅ Clicks through "Read post" to open and read the external article too
  • ✅ Cookie-based authentication (no login required)
  • Auth verification — decodes the session JWT to confirm you're actually logged in before reading
  • Auto-refreshes cookies — persists the browser's refreshed session back to user-cookie.json after every run
  • Reading streak tracking — reports streak before/after each run
  • Telegram notifications for run start, completion, and auth failures
  • ✅ Detailed logging with loguru

Setup

Prerequisites

  • Python 3.12+
  • uv package manager

Installation

# Install dependencies
uv sync

# Install Playwright browsers
uv run playwright install chromium

Cookie Setup

  1. Login to daily.dev in your browser
  2. Export cookies using a browser extension (e.g., "Cookie Editor")
  3. Save the exported cookies as user-cookie.json in the project root

Cookies are automatically refreshed and re-saved to user-cookie.json after each run, so re-exporting is only needed if the session actually expires (auth failures are reported via Telegram).

Telegram Notifications (optional)

  1. Copy .env.example to .env
  2. Create a bot with @BotFather and get the bot token
  3. Get your chat ID (e.g. via @userinfobot)
  4. Fill in TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, and optionally TELEGRAM_THREAD_ID in .env

If left unconfigured, the script runs normally and just skips notifications.

Usage

# Run the auto reader
uv run python main.py

Running on a schedule (cron)

run.sh is a cron-ready wrapper that cds into the project, runs it with uv (falling back to the local .venv), and appends output to cron.log. Update PROJECT_DIR in run.sh to match your deployment path, then add it to crontab, e.g.:

0 9,15,20 * * * /path/to/daily-dev-auto-reader/run.sh

Configuration

Edit the constants in main.py to customize behavior:

Setting Default Description
MIN_ARTICLES 2 Minimum articles to read per run
MAX_ARTICLES 4 Maximum articles to read per run
READ_TIME_MIN 15s Minimum time spent "reading" each article
READ_TIME_MAX 40s Maximum time spent "reading" each article
SCROLL_PAUSE_MIN 1.0s Minimum pause between scroll actions
SCROLL_PAUSE_MAX 3.0s Maximum pause between scroll actions
FEED_LOAD_WAIT 5s Wait time after navigating to the feed
EXTERNAL_READ_WAIT 20s Time spent on the external article opened via "Read post"

Note: the browser currently launches with headless=False (visible window) — set headless=True in main.py if running on a headless server.

How It Works

  1. Launch Chromium browser and load cookies for authentication
  2. Navigate to the daily.dev feed and verify the session is actually authenticated (decodes the da3 JWT cookie)
  3. Capture the current reading streak
  4. Scroll through the feed to load articles
  5. Collect article links (filtering out promoted/ad content)
  6. Randomly select 2-4 articles and read each one with human-like scroll behavior, following "Read post" through to the external article when available
  7. Return to the feed and capture the reading streak again
  8. Persist the refreshed session cookies back to user-cookie.json
  9. Report results (articles read, streak change, duration) via logs and Telegram

About

Automate daily reading on daily.dev with Playwright — human-like scrolling, streak tracking, auto-refreshing cookies, and Telegram notifications.

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages