Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tcelestino/mega-sena-results
Send latest mega sena results contest via email
https://github.com/tcelestino/mega-sena-results
hacktoberfest webscraping
Last synced: about 9 hours ago
JSON representation
Send latest mega sena results contest via email
- Host: GitHub
- URL: https://github.com/tcelestino/mega-sena-results
- Owner: tcelestino
- License: mit
- Created: 2020-09-07T15:17:56.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T20:31:59.000Z (about 1 year ago)
- Last Synced: 2024-01-08T21:48:01.493Z (about 1 year ago)
- Topics: hacktoberfest, webscraping
- Language: JavaScript
- Homepage:
- Size: 563 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Mega Sena Results
Send the latest [Mega Sena](http://loterias.caixa.gov.br/wps/portal/loterias/landing/megasena/) results contest via email with web scraping and [Github Actions](https://github.com/features/actions)
## Requirements
- [Node 12.x.x](https://nodejs.org/en/);
- [yarn](https://yarnpkg.com/);## Dependencies
- [nodemailer](https://nodemailer.com/)
- [Puppeteer](https://github.com/puppeteer/puppeteer)
- [dotenv](https://github.com/motdotla/dotenv)## Installation
Clone repo
```bash
git clone [email protected]:tcelestino/mega-sena-results.git
```Install the packages
```bash
yarn install
```Rename .env.example to .env
### Environments variables
| 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 | [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](https://security.google.com/settings/security/apppasswords)
## How to use
### Local
Set enviroments and run:
```bash
yarn start
```### On Github Actions
Create [Secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-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](.github/workflow/runner.yml).
```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](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#schedule)
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature` or `git checkout -b issue-{number}`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature` or `git push origin issue-{number}`
5. Submit a pull request## TODO
See [issues](https://github.com/tcelestino/mega-sena-results/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) or the [kanban](https://github.com/tcelestino/mega-sena-results/projects/1)
## Credits
[@tcelestino](https://github.com/tcelestino)
## License
[MIT](LICENSE)