This simple app intends to share on twitter the electric mix of Reunion Island twice a day (at midday and 10:00 PM). Data is based on Open API https://opendata-reunion.edf.fr (dataset: prod-electricite-temps-reel) from EDF. Licence of data: https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf
Define them for Twitter as environnement variable while running the script
CONSUMER_KEY
CONSUMER_SECRET
ACCESS_KEY
ACCESS_SECRET
The script only call EDF API to extract data and then send it to Twitter. To make it callable twice a day, simply use crontab.
crontab -e
# 0 12 * * * CONSUMER_KEY=<your_key> CONSUMER_SECRET=<your_key> ACCESS_KEY=<your_key> ACCESS_SECRET=<your_key> node <path_to_script>/index.js
# 0 22 * * * CONSUMER_KEY=<your_key> CONSUMER_SECRET=<your_key> ACCESS_KEY=<your_key> ACCESS_SECRET=<your_key> node <path_to_script>/index.js