diegofpb / em_weather

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weather Forecast Web App

Overview

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.

Features

  • 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.

How to Use

Requirements

  1. AEMET API Token: You need to obtain an API token from the AEMET OpenData platform.
  2. Municipality Code: Obtain the municipality code for the location you want to get weather information for from SEPE.

Setup

  1. Clone the repository:

    git clone https://github.com/diegofpb/em_weather.git
  2. Navigate to the project directory:

    cd em-weather
  3. 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:

    Preview rendered HTML of Madrid

    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.

Technologies Used

  • HTML5
  • CSS3
  • JavaScript (Fetch API for API requests)

License

This project is licensed under the MIT License.

Acknowledgments

About

License:MIT License


Languages

Language:JavaScript 83.9%Language:CSS 10.2%Language:HTML 5.8%