← Statpro dev log

ESPN fantasy leagues connect from inside the app

#sports#product#automation

Two chain links joined, one dim and one glowing amber, between a dashed outline of an unseen league and a column of lineup slots

Half my fantasy leagues, where friends draft rosters and set a lineup each week, live in ESPN. Until last night Statpro, my sports stats and betting-research site and app for the casual fan, couldn't see any of them. Statpro also has a fantasy football section with weekly rankings and start/sit advice, so linking my leagues mattered to me. Getting a lineup in meant copying a league ID, pasting it into the right box on the web, and hoping every digit was right. Three commits changed that in one night.

The dull commit went first

First, public leagues started linking by league ID. That sounds boring, and it's what made the next two commits possible. Then the app got a real connect flow: I type the league ID in the app itself and the league shows up linked, with no web detour. A plan commit earlier that night had sketched the whole import of an ESPN league into the app, so the rest was sequencing.

The part I care about came last. Linked ESPN leagues now get lineup and waiver suggestions (who to pick up from the pool of unrostered players) from the same player projections behind the site's weekly fantasy rankings. The starting lineup gets scored before the games start, and the waiver wire is ranked by the same math instead of a hot-take feed.

TWO WAYS IN Paste a league ID on the web Connect inside the app League linked Lineup and waiver suggestions scored by the same models as every matchup
The in-app path only became possible once leagues could link by ID.

The hashtag stripper ate the ranks

One gotcha from the same night will be familiar to anyone who posts to several platforms. The titles of the photo slideshows that Statpro posts to TikTok automatically kept losing ranks like "#1". I strip hashtags from titles because TikTok wouldn't publish one containing a #, and the stripper removed any word that started with #. The fix is one rule, a # followed by a digit is a rank:

// was: strip anything starting with #
// now: a # before a digit is a rank, keep it
if (next === '#' && /\d/.test(after)) keep('#');

Nothing here is clever. The dull linking step went in first, and that's why the visible features fit into a single night.

This is the build log for Statpro (statpro.io) · All entries · Weekly essays