- node.js >= 10.0
- mongodb database
- clone the git@github.com:qmmr/fifa-worldcup-2018-scraping.git
cd fifa-worldcup-2018-scraping
- create
.env
file to set env variables needed to connect to your chosen MongoDB server- dotenv
- If you want to use your local development server you can use these.
DB_USER=admin DB_PASSWORD=password DB_HOST=127.0.0.1 DB_PORT=27017 DB_NAME=fifa-worldcup-2018
- make the files executable
chmod u+x ./insert-teams.mjs ./insert-games.mjs ./update-teams.mjs ./insert-lineups.js ./insert-groups.js
- run the commands in this order:
node -r esm src/insert-teams.js
node -r esm src/insert-games.js
node -r esm src/update-teams.js
node -r esm src/insert-lineups.js
node -r esm src/insert-groups.js
- Insert teams populates your DB with teams data from
teams.json
. - Insert games scrapes the https://www.fifa.com/worldcup/matches/ and populates your DB with games data.
- Update teams associates the games with teams (in order to fetch teams games).
- Insert lineups scrapes the match lineups from fifa.com/worldcup/matches/match (example match)
- Insert groups insert information about groups and results of games
Have fun! 👋