Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Barça Match Reports

Scrapes FotMob and Sofascore for FC Barcelona match data and generates formatted match reports (text + charts) for posting on X.

Report structure (every report follows this order)

  1. Hook insight — one sharp sentence, written last
  2. xG vs actual — over/under-performance
  3. Buildup & progression patterns
  4. Pressing structure — PPDA, triggers
  5. Opponent-specific exploits
  6. Set-piece breakdown
  7. Underused player / tactical wrinkle
  8. Visuals — shot map, xG timeline, pass map
  9. Forward-looking note

Project structure

config/
  config.js          Team IDs, endpoint paths, request settings (placeholders for now)
src/
  scrapers/
    fotmob.js         FotMob JSON endpoint calls
    sofascore.js       Sofascore JSON endpoint calls
  processors/
    normalize.js       Merges both sources into one match object
  insights/
    index.js           One function per report section, finds the findings
  charts/
    index.js            Renders shot maps, xG timelines, pass maps as images
  templates/
    report.js           Assembles insights + charts into the final report
  index.js               Pipeline entry point
data/
  raw/                 Cached raw scrape responses
  reports/             Generated reports

Setup

npm install
cp .env.example .env

Status

Skeleton only — every module has TODOs. Next steps:

  1. Map real FotMob/Sofascore JSON endpoints (via browser dev tools, Network tab, on an actual match page) and fill them into config/config.js
  2. Wire up src/scrapers/fotmob.js and src/scrapers/sofascore.js against those real endpoints
  3. Fill in src/processors/normalize.js once we've seen real response shapes
  4. Implement insight functions in src/insights/index.js
  5. Implement chart functions in src/charts/index.js
  6. Wire it all together in src/index.js

Scraping etiquette

FotMob and Sofascore's JSON endpoints are unofficial/internal — not public APIs. Keep request frequency low (see config.request.minDelayMs), avoid redistributing raw scraped data, and only publish transformative analysis (insights/reports built from the data, not the raw data itself).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages