#meteo_data.sh
The meteo_data.sh
script is a command-line tool that allows you to retrieve weather data and forecasts for a specific city using the OpenWeatherMap API. It provides information such as current temperature, wind speed, humidity, and cloudiness.
- Retrieve weather data for a specific city
- Units of measurement can be specified (metric, imperial, standard)
- Get current temperature, wind speed, humidity, and cloudiness
curl
command-line tooljq
command-line tool- OpenWeatherMap API key
- Make sure you have the
curl
andjq
command-line tools installed on your system. - Obtain an API key from OpenWeatherMap.
- Clone the repository or download the
meteo_data.sh
script to your desired location. - Open the
meteo_data.sh
script in a text editor. - Replace the placeholder
"your_api_key"
with your actual API key obtained from OpenWeatherMap. - Save the changes and close the file.
Make the meteo_data.sh
script executable with the following command:
chmod +x meteo_data.sh
The meteo_data.sh
script can be run from the command line with various options.
./meteo_data.sh [-c city] [-u units] [-p param]
-c city
: Specify the city for which you want to fetch weather data. Defaults to "Bucharest".-u units
: Specify the units of measurement for the weather information. Options: "metric" (default), "imperial" or "standard".-p param
: Specify the parameter to retrieve. Options: "t" (current temperature, default), "w" (wind speed), "h" (humidity), "c" (cloudiness).
-
Retrieve the current temperature for the default city (Bucharest) using metric units:
./meteo_data.sh
-
Retrieve the weather data for Pitesti with imperial units:
./meteo_data.sh -c Pitesti -u imperial
-
Get the wind speed for Iasi:
./meteo_data.sh -c Iasi -p w
- scriubuguri
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.