Skip to content

Get weather data for any location in the world using Bash and OpenWeatherMap API

License

Notifications You must be signed in to change notification settings

WalidGharianiEAGLE/getweather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

This Bash script allows you to obtain current weather data for any location in the world by providing a city name and an OpenWeatherMap API key. The script provides temperature, weather condition, and an ASCII art representation of the weather conditions.

Getting Started

Prerequisites

Before using this script, you need to sign up for an OpenWeatherMap API key. You can obtain an API key by creating an account at OpenWeatherMap.

Install jq (command-line JSON processor). If jq is not already installed on your system, you can download and install it from the official website https://jqlang.github.io/jq/download/. For example on Debian/Ubuntu-based

sudo apt-get install jq

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/WalidGharianiEAGLE/getweather.git
  2. Navigate to the project directory:

    cd getweather
  3. Make the script executable:

    chmod +x getweather.sh

Usage

  1. Run the script:

    ./weather.sh
  2. When prompted, enter your OpenWeatherMap API key.

  3. Enter the city for which you want to retrieve weather information.

  4. The script will display the weather data, including temperature, weather description, and an ASCII art representation of the weather conditions.

Enter the city for weather information: Berlin
City: Berlin
Country: DE
Coordinates: [52.5244, 13.4105]
Temperature: 16.56 °C (min: 14.49, max: 18.32)
Humidity: 70 %
Air Pressure: 1012 hPa
Wind: 4.12 m/s SW
Visibility: 10.00 km
Weather: Clear, clear sky
ASCII Art Representation:
🌞🌞

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Get weather data for any location in the world using Bash and OpenWeatherMap API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages