This project is a web application that displays the current weather and forecasts for the next two days. The design is optimized for small screens, adhering to the Digital Audio Broadcasting (DAB) standard.
- Current Weather: View the current weather conditions.
- Two-Day Forecast: Get forecasts for the next two days.
- Responsive Design: Adapted to smaller screens, following the DAB standard.
- AEMET API Token: You need to obtain an API token from the AEMET OpenData platform.
- Municipality Code: Obtain the municipality code for the location you want to get weather information for from SEPE.
-
Clone the repository:
git clone https://github.com/diegofpb/em_weather.git
-
Navigate to the project directory:
cd em-weather
-
Open
em-weather.html
in your web browser, and add the following query params:- token: Your AEMET API Token
- municipioId: The Municipality Code.
For example, with token XXXX and the municipality code of Madrid (28079):
http://127.0.0.1:3000/em-weather.html?municipioId=28079&token=XXXX
You will get the following rendered HTML:
Note that the HTML file will be rendered instantly, but not the weather data, since these have to be obtained from calls to the AEMET API, and it can take up to 10 seconds to answer the request in certain cases. If it is intended to obtain an image of such information, it is recommended to give a delay of approximately 10 seconds.
- HTML5
- CSS3
- JavaScript (Fetch API for API requests)
This project is licensed under the MIT License.
- Weather data provided by AEMET OpenData.