Send the latest Mega Sena results contest via email with web scraping and Github Actions
Clone repo
git clone [email protected]:tcelestino/mega-sena-results.git
Install the packages
yarn install
Rename .env.example to .env
Variable | Description | Value |
---|---|---|
EMAIL_SERVICE | Service email | gmail |
EMAIL_HOST | Configure SMTP host | smtp.gmail.com |
EMAIL_PORT | Set port to host | 465 |
EMAIL_USER | [email protected] | |
EMAIL_PASS | Password email | -- |
EMAIL_FROM | Set email from | [email protected] |
PAGE_URL | Page to scraping results | https://noticias.uol.com.br/loterias/mega-sena/ |
EMAIL_PASS - if you use Gmail as email service and if you are using 2FA you would have to create an “Application Specific” password for Nodemailer to work. Click here
Set enviroments and run:
yarn start
Create Secrets with environments variables.
Actually the action will run at 6am on wednesday, friday and sunday. You can change this schedule in .github/workflow/runner.yml.
name: Main pipeline
on:
schedule:
- cron: '00 09 * * 3,5,0' # at 6am (UTC -3) on wednesday, friday and sunday
...
Is wrong? No!! Github Actions does not enable to timezone settings. This schedule is based on UTC (-3h). Read more here
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
orgit checkout -b issue-{number}
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
orgit push origin issue-{number}
- Submit a pull request