Add Emoji to Meteo

This commit is contained in:
LucasVbr
2022-06-06 17:56:26 +02:00
parent 512c0896c0
commit 2707eecbd9
3 changed files with 75 additions and 4 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ from flask import Flask, render_template
from src.Badge import Badge, getBadgeColor
from meteofrance_api import MeteoFranceClient
from src.FileUtils import setFileData, getJsonData
from src.meteoEmoji import EMOJIS
"""
05/06/2022
@@ -38,7 +39,8 @@ def getWeather(city: str) -> dict:
return {
"temperature": weather.get('T').get('value'),
"description": weather.get("weather").get("desc")
"description": weather.get("weather").get("desc"),
"icon": EMOJIS.get(weather.get("weather").get("icon"))
}
+69
View File
@@ -0,0 +1,69 @@
EMOJIS = {
"p1j": ":sunny:",
"p1n": ":full_moon:",
"p2j": ":partly_sunny:",
"p2n": ":cloud:",
"p3j": ":cloud:",
"p3n": ":cloud:",
"p4j": ":fog:",
"p4n": ":fog:",
"p5j": ":fog:",
"p5n": ":fog:",
"p6j": ":fog:",
"p6n": ":fog:",
"p7j": ":fog:",
"p7n": ":fog:",
"p8j": ":fog:",
"p8n": ":fog:",
"p9j": ":cloud_with_rain:",
"p9n": ":cloud_with_rain:",
"p10j": ":cloud_with_rain:",
"p10n": ":cloud_with_rain:",
"p11j": ":cloud_with_rain:",
"p11n": ":cloud_with_rain:",
"p12j": ":cloud_with_rain:",
"p12n": ":cloud_with_rain:",
"p13j": ":cloud_with_rain:",
"p13n": ":cloud_with_rain:",
"p14j": ":cloud_with_rain:",
"p14n": ":cloud_with_rain:",
"p15j": ":cloud_with_rain:",
"p15n": ":cloud_with_rain:",
"p16j": ":cloud_with_lightning:",
"p16n": ":cloud_with_lightning:",
"p17j": ":cloud_with_snow:",
"p17n": ":cloud_with_snow:",
"p18j": ":cloud_with_snow:",
"p18n": ":cloud_with_snow:",
"p19j": ":cloud_with_snow:",
"p19n": ":cloud_with_snow:",
"p20j": ":cloud_with_snow:",
"p20n": ":cloud_with_snow:",
"p21j": ":cloud_with_snow:",
"p21n": ":cloud_with_snow:",
"p22j": ":cloud_with_snow:",
"p22n": ":cloud_with_snow:",
"p23j": ":cloud_with_snow:",
"p23n": ":cloud_with_snow:",
"p24j": ":cloud_with_lightning:",
"p24n": ":cloud_with_lightning:",
"p25j": ":cloud_with_lightning:",
"p25n": ":cloud_with_lightning:",
"p26j": ":cloud_with_lightning:",
"p26n": ":cloud_with_lightning:",
"p27j": ":cloud_with_lightning:",
"p27n": ":cloud_with_lightning:",
"p28j": ":cloud_with_lightning:",
"p28n": ":cloud_with_lightning:",
"p29j": ":cloud_with_lightning:",
"p29n": ":cloud_with_lightning:",
"p30j": ":cloud_with_lightning:",
"p30n": ":cloud_with_lightning:",
"p31j": ":star:",
"p31n": ":star:",
"p32j": ":tornado:",
"p32n": ":tornado:",
"p33j": ":tornado:",
"p33n": ":tornado:",
}
+3 -3
View File
@@ -2,8 +2,8 @@
# Hello there ! {{ imageWithSize(data.info.hi_img) }}
I'm {{ data.info.name }}, a passionate developer from {{ imageWithSize(data.info.france_img) }} {{ data.info.city }}, France.
<br>Currently, the weather is: **{{ data.weather.temperature }}°C**, **{{ data.weather.description }}**
I'm {{ data.info.name }}, a passionate developer from {{ imageWithSize(data.info.france_img) }} **{{ data.info.city }}, France**.
<br>Currently, the weather is: **{{ data.weather.temperature }}°C** :thermometer:, **{{ data.weather.description }}** {{ data.weather.icon }}
### I code with
{% for img in data.tools -%}
@@ -18,7 +18,7 @@ I'm {{ data.info.name }}, a passionate developer from {{ imageWithSize(data.info
<div align="center">
This README is generated every 3 hours.<br>
This **README** is generated **every 3 hours**.<br>
Last refresh: **{{ data.today }}** ({{ data.info.timezone }})<br>
{% for img in data.footer_badges -%}
{{ image(img) }}