Files
WeatherToFreemobile/README.md

54 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# WeatherToFreemobile
## English
A simple script that sends [OpenWeatherMap](https://openweathermap.org/) forecasts as a text message to a [FreeMobile](http://mobile.free.fr/) phone.
To run the script you need to fill in `config.sample.json` and to rename it to `config.json`.
You will need a [API key from OWM](https://home.openweathermap.org/api_keys), and [one from FreeMobile](https://www.universfreebox.com/article/26337/Nouveau-Free-Mobile-lance-un-systeme-de-notification-SMS-pour-vos-appareils-connectes).
See `requirements.txt` for the script's requirements. A quick way to set is up is by running, from the scripts directory:
```
python -m venv .venv
.venv/bin/pip install -r requirements.txt
```
You can then run the script using `.venv/bin/python weather_to_freemobile.py`
Sample output:
```
Saturday 19: light rain (1.5mm), 13ºC - 15ºC
- 09h : 0.3mm
- 12h : 0.2mm
- 15h : 0.2mm
- 18h : 0.1mm
- 21h : 0.2mm
Sunday 20: moderate rain (12.0mm), 12ºC - 13ºC
```
## French
Un simple script pour envoyer les prévisions météo [OpenWeatherMap](https://openweathermap.org/) par SMS sur un téléphone [FreeMobile](http://mobile.free.fr/).
Pour lancer le script, vous avez besoin d'ajuster les éléments du fichier `config.sample.json` et le renommer en `config.json`.
Vous aurez besoin dune [clef API OpenWeatherMap](https://home.openweathermap.org/api_keys), et une [clef API SMS FreeMobile](https://www.universfreebox.com/article/26337/Nouveau-Free-Mobile-lance-un-systeme-de-notification-SMS-pour-vos-appareils-connectes).
Le fichier `requirements.txt` vous donne les dépendances à installer pour le script. Vous pouvez configurer en environnement en lançant les commandes suivantes depuis le répertoire du script:
```
python -m venv .venv
.venv/bin/pip install -r requirements.txt
```
Pour lancer le script, utilisez `.venv/bin/python weather_to_freemobile.py`
Exemple de SMS:
```
Samedi 19: légère pluie (1.5mm), 13ºC - 15ºC
- 09h : 0.3mm
- 12h : 0.2mm
- 15h : 0.2mm
- 18h : 0.1mm
- 21h : 0.2mm
Dimanche 20: pluie modérée (12.0mm), 12ºC - 13ºC
```