← Back to Lab Lab Project — Automation

Fantasy Baseball Command Center

Running 3 fantasy leagues across the MLB season through one integrated system — Yahoo API, Discord bot, scout notes database, automated reports.

以一套整合系統貫穿整季 MLB 的三個 Fantasy 聯盟——Yahoo API、Discord bot、scout notes 資料庫、自動化報告。

Scope 3 Leagues · 56 Teams 三聯盟・56 支隊伍
Status Live · In Season 賽季中持續運轉
Type Personal Operations Tool 個人作戰系統
Role Solo Builder + User 開發者與使用者合一
01

The Problem

起點

Running three fantasy baseball leagues simultaneously — each with different scoring systems, different roster rules, different waiver timings — is a second full-time job. Yahoo Fantasy's native interface was built for one casual league, not three competitive ones.

I needed a single control surface: live rosters from all three leagues, scout notes on every player I cared about, FA sleeper rankings that matched each league's scoring, Discord alerts for injury news, and a weekly workflow that didn't rely on me remembering anything.

同時跑三個 Fantasy Baseball 聯盟——各自的計分規則、陣容限制、waiver 時間都不同——等於第二份全職工作。Yahoo Fantasy 原生介面是給單一休閒聯盟用的,不是給認真打三盟的人用的。我需要一個統一的作戰面板:三盟即時陣容、每個我在意的球員的 scout notes、針對每個聯盟計分制度客製化的 FA 排名、傷病 Discord 推播、還有不靠記憶的週度工作流程。

02

The System

系統規模

3 Leagues managed 聯盟數
56 Teams tracked 隊伍總數
178 Scout notes 球員筆記
10 Tools built 自建工具
03

The Toolkit

工具組

FA Sleeper Report

Scans waiver wire across all 3 leagues, ranks players by each league's exact scoring system (H2H cats, headpoint with K-negatives, etc.).

The most-used tool in the kit. Runs daily via cron and pings Discord.

Roster Optimizer

Starting lineup suggestions with IP budget management (weekly caps vary by league). Handles two-start pitcher prioritization.

Knows each league's rules and respects them.

Scout Notes Database

178 active player notes with priority tiers, trend flags, and free-form commentary. Weekly snapshots backed up to R2.

The long-term memory. Diff tracking shows how my evaluations evolve.

Discord Bot

Player lookup pipeline: Yahoo → FanGraphs → Baseball Savant → scout notes. One command to get a complete player report from any phone.

The mobile interface that makes the whole system usable from bed at 2am.

Weekly Report Generator

Auto-generated matchup analysis with win probability, category leads, and opponent weakness scan. Delivered Monday morning.

Replaces staring at the Yahoo app for an hour every week.

Trade Analyzer

Cross-league trade evaluation using rest-of-season projections adjusted for each league's scoring system.

Prevents trades that look good in one league's scoring and terrible in another.

D1 Cloud Backend

Cloudflare D1 stores player projections from 3 sources (FanGraphs, fg2026, Yahoo) with merge priority logic. Daily automated backup to R2.

178 rows of scout notes + 3840 player projections. GitHub Actions backs it up every morning at 03:00 Taipei.

Dashboard

A static dashboard at fantasy.mursfoto.com showing all 3 leagues side by side — live rosters, recent moves, scout note priorities.

Vanilla HTML/JS, deployed via Cloudflare Pages. No framework bloat.

04

Tech Stack

技術棧

Data Sources

  • Yahoo Fantasy API
  • pybaseball (FanGraphs wrapper)
  • Baseball Savant scraper
  • Manual scout notes

Backend

  • Python 3.12
  • Cloudflare D1 (SQLite)
  • Cloudflare KV (cache)
  • Local cron + Discord webhooks

Frontend

  • Vanilla HTML + JS dashboard
  • Cloudflare Pages hosting
  • Auto-deploy via GitHub Actions
  • Mobile-friendly tables

Safety Net

  • Daily D1 backup to R2
  • Weekly scout notes backup
  • Size-checked backup integrity
  • GitHub Actions cron
05

What This Proves

這套系統證明了什麼

  • I build the tools I use. This system exists because I needed it, not because it's a portfolio project. Tools built for yourself get iterated until they're actually good.
  • Automation is about focus, not laziness. The goal isn't to save time — it's to redirect attention away from bookkeeping toward actual decisions (trades, waiver priorities, lineup calls).
  • Mobile-first ops matter. The Discord bot is the killer feature. A fantasy system that requires sitting at a desk isn't a fantasy system — it's homework.
  • Backup discipline separates toy projects from real ones. Daily D1 backups to R2 with integrity checks. Weekly scout notes snapshots. Because losing 178 hand-written scout notes would be unrecoverable.

See the live dashboard

看看實際運作

fantasy.mursfoto.com ↗