Small Sinatra app that scrapes the live Columbus Crew roster page and exposes the roster as JSON, plus a simple browser UI.
- Target URL:
https://www.columbuscrew.com/roster/ - Scraping is live at request time (no local database).
- Roster cards UI at
/ - Player detail UI at
/player/:id - API endpoints:
GET /playersGET /players/:id
Each player record currently includes:
idnamenumposroleimgbio_urlstats_urlsourceagebirthplaceheightweight
Notes:
age,birthplace,height, andweightare currently returned asnullbecause they are not present on the roster page markup being scraped.- Image URLs are pulled from lazy-loaded image attributes on the source roster cards.
asdf(recommended, because project uses.tool-versions)- Ruby
4.0.1 - Bundler (installed with Ruby)
asdf installmake startThis will:
- run
bundle install - start the app with
rackupon port9393 - write PID to
.app.pid - write logs to
.app.log
Useful commands:
make status
make stopasdf exec bundle install
asdf exec bundle exec rackup -p 9393Open:
http://localhost:9393/
View Raw JSONbutton opens a modal.- Modal fetches
/playersand displays formatted JSON. - Modal closes via:
Closebutton- clicking the backdrop
Esckey
- If old/stale data appears, ensure only one app process is running and restart with
make stopthenmake start. - If startup fails, inspect
.app.log. - If scraping breaks, the source site likely changed markup; update selectors in
player.rb.