Ruby-based console application for retrieving and displaying weather forecasts and climate data via the World Weather Organization (WMO) API.
This application requests weather data for a selected city, processes the JSON response, and outputs information about tomorrow's temperature forecast and average monthly climate indicators in a readable format.
- Retrieve tomorrow's weather forecast (minimum and maximum temperature)
- Display average monthly temperature for the current month
- Console output with formatted data
- Ruby 3.4.5 - Primary programming language
- WMO API - Weather data source from World Weather Organization
- Using
Net::HTTPmodule to send GET requests - URI parsing with
URI.parse - Working with external APIs
- Parsing JSON responses from API
- Navigating nested data structures
- Extracting specific data from complex objects
- Using
DateandDateTimelibraries - Date formatting and manipulation
- Current month determination
- Integration with public WMO API
- Extracting necessary data from structured API responses
- Error handling for network requests
- Data extraction and formatting
- String interpolation
- Console output formatting
ruby weather_json.rb- Ruby 3.x or higher
- Internet connection for API access
pogoda_json/
├── pogoda_json.rb # Main application file
├── city_list.txt # List of available cities with IDs
├── .gitignore # Git ignore rules
└── README.md # Project documentation
City: Kharkiv
Temperature tomorrow from 5 °C to 12 °C
Average monthly temperature from 3 °C to 10 °C
The application demonstrates:
- RESTful API consumption
- JSON data parsing and manipulation
- Date/time operations in Ruby
- String formatting and interpolation
- Ruby standard library usage (
net/http,uri,json,date)
This application uses the World Weather Organization API:
- Base URL:
https://worldweather.wmo.int/en/json/ - Response Format: JSON
- Data Includes: Current forecasts, climate data, temperature ranges