We don't want to miss any of these.
- It loads the https://pivotal.io/security web page, and parses it's content picking all table rows from it.
- It builds an object in itself, for each row detected.
- It checks, if the leak has been reported to Datadog before. - If it hasn't, it will send a new event. - If it has, it will continue to the next entry.
- It has ability to send a checks to the Datadog, reporting of it's health.
The script, should be running just fine on both python 2 and 3.
You should install the required dependencies:
pip install -r requirements.txt
Once all dependencies are installed and everything is configured, you can run:
scrapy runspider pivotal.py
The script, should take only few seconds. Therefore, it's save to add it to the cron job, running even every 5 minutes.
import utils
utils.Report.critical("Critical message") # Report status CRITICAL.
utils.Report.ok("OK message") # Report status OK.
utils.Report.warning("Warning message") # Report status WARNING.
Refer to the official documentation.