tchapgouv / matrix-rageshake-crisp

Extract email from matrix rageshake with Crisp API
0 stars 0 forks source link

matrix-rageshake-crisp

This script searches for conversations on the Crisp API that have the RAGESHAKE_EMAIL as a participant. It replaces this email by the "email :" field found in the rageshake description.

It interacts with crisp by a Plugin published here : https://marketplace.crisp.chat/plugins/ If dev tokens reach max quota (429 Client Error: Too Many Requests), they can be reset here : https://marketplace.crisp.chat/plugins/plugin/50c492e5-7175-45d0-a449-913aa8bc6cfd/tokens/

Logs

https://dashboard.scalingo.com/apps/osc-secnum-fr1/tchap-rageshake-crisp/logs

Setup

The following environment variables must be set before running the script:

For the statistics export to the S3 OVH bucket

Crisp plugin is defined here : https://marketplace.crisp.chat/plugins/plugin/50c492e5-7175-45d0-a449-913aa8bc6cfd/tokens/

Usage

To run the script, simply run the following command:

pipenv install
python3 extract_email_from_rageshake_on_crisp.py

deployment

Deactivate the web process in scalingo : https://doc.scalingo.com/platform/app/web-less-app

Tests

python3 extract_email_from_rageshake_on_crisp.test.py