Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

EpocDotFr/titanic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Titanic

A Python script that send emails when a specific French business is officially closed.

Prerequisites

Python 3.

Installation

Clone this repo, and then the usual pip install -r requirements.txt.

Configuration

Copy the .env.example file to .env and fill in the configuration parameters.

Available configuration parameters are:

  • SURVIVORS A comma-separated list of emails that will receive the "Titanic sunk!" email
  • SIREN The SIREN of the business to check for (no spaces)
  • SMTP_* Self-explanatory parameters

Usage

python run.py [--drill]

--drill make the specified business randomly closed or not to test emails sending.

Best usage is to create a CRON job that launch Titanic once a day (more is useless):

# Every day at 6PM
0 18 * * * cd /path/to/titanic && python run.py 2>&1

How it works

This script use the Firmapi service to check if the specified business (SIREN parameter) is unlisted from the RCS. If yes, emails are sent through SMTP (SMTP_* parameters) to the specified recipients (SURVIVORS parameter). A file is then created in the same directory ({SIREN}.sank) to prevent further useless calls to Firmapi.

About

Python script that send emails when a specific French business is officially closed

Topics

Resources

License

Stars

Watchers

Forks

Languages