https://github.com/humbertodias/docker-scrapy-mailer
Docker Scrapy Mailer
https://github.com/humbertodias/docker-scrapy-mailer
cron-schedule docker mako-framework python scrapy
Last synced: 3 months ago
JSON representation
Docker Scrapy Mailer
- Host: GitHub
- URL: https://github.com/humbertodias/docker-scrapy-mailer
- Owner: humbertodias
- Created: 2017-12-16T15:37:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-11T04:19:35.000Z (about 8 years ago)
- Last Synced: 2025-03-02T02:09:03.438Z (over 1 year ago)
- Topics: cron-schedule, docker, mako-framework, python, scrapy
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Scrapy Mailer
It's a simple [Docker](https://www.docker.com) container that uses [Scrapy](https://scrapy.org) library to grab and parse a website, generating parsable JSON file.
After that we bind the JSON with a [Mako](http://www.makotemplates.org) template, resulting in a dynamic mail content.
Finally, we send it according to the **MAIL_TO** informed environment variable.
## Pre Requirements
1. [Docker](https://docs.docker.com/install) 18+
## How to Run
Build
```
docker build -t docker-scrapy-mailer:latest .
```
Run
```
docker run -e MAIL_FROM="from@mail" \
-e MAIL_FROM_PASSWORD="***" \
-e MAIL_TO="to1@mail,to2@mail,to3@mail" \
-e MAIL_SUBJECT="Mail Subject" \
-e MAIL_TEXT="Mail Text Body" \
-e MAIL_SMTP_HOST="smtp.mail" \
-e MAIL_SMTP_PORT="587" \
-e CRON_SCHEDULE="*/1 * * * *" \
-ti docker-scrapy-mailer
```
To make your **CRON_SCHEDULE** exception easily use the serive [CronTab Generator](https://crontab-generator.org)
Like

## References
* [CronTab Generator](https://crontab-generator.org)
* [Scrapy](https://scrapy.org)
* [Mako](http://www.makotemplates.org)