Welcome to OpenWeatherPlace! This application allows you to get the current weather for any city using the OpenWeatherMap API. This project is written in C++ and leverages modern libraries for integration with external APIs.
- Weather Query: Get detailed information about the current weather for any city.
- API Integration: Connects to the OpenWeatherMap API for accurate and up-to-date data.
- Secure Configuration: Uses a
.env
file to securely manage environment variables like the API key. - Error Handling: Implements validations and error handling for a robust experience.
- CMake for project setup.
- External libraries:
cpr
for HTTP requests.nlohmann/json
for JSON handling.
- Clone this repository:
git clone https://github.com/your-username/WeatherApp.git
cd WeatherApp
- Install dependencies:
vcpkg install cpr nlohmann-json
- Create a
.env
file in the executable folder with your OpenWeatherMap API key:
API_KEY=YOUR_API_KEY
- Configure and build the project with CMake:
mkdir build
cd build
cmake ..
make
To run the application, use the following command in the terminal:
./weather
Name of the city: Tokyo
The weather in Tokyo is: clear sky
Temperature: 15.6°C
Contributions are welcome! If you have any improvements or find any issues, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.