Revision history for Weather::Meteo
0.16 Mon Nov 23 10:13:37 EST 2026
[ Enhancements ]
- Retry transient API failures (HTTP 429, 502, 503, 504) with exponential
backoff, honouring a numeric Retry-After header (waits capped at 60s)
- Add max_retries (default 3, 0 disables) and retry_delay (default 1s)
options to new()
- Add i18n() and a messages option to new(): every warning and error is
now looked up by key and can be translated or reworded; supports
{name} placeholders, plural/gender variants and sprintf arguments
- forecast() and sunrise_sunset() now carp with the API's reason when
the API reports {"error":true}, as weather() already did
[ Bug Fixes ]
- Mark helper routines as protected
- weather() returned data for a pre-1940 date given as an object with
strftime(); it now returns undef silently, as for a string
- Dates and days were matched with $ so a trailing newline was accepted;
now anchored with \z, and dates are untainted
- The rate limiter used whole-second time() and could wait for the wrong
length of time; it now uses Time::HiRes::time()
- The JSON body was decoded twice (once by HTTP::Message, once as UTF-8);
non-ASCII text in a response could fail to parse
[ Internal ]
- Coordinate, call-form, URL, cache and error handling that was copied
into weather(), forecast() and sunrise_sunset() is now shared
- Helper functions are Sub::Private (enforce mode), helper methods are
Sub::Protected; both are relaxed under a test harness
- Magic numbers and strings moved into Readonly tables
- bin/weather: shared safe_path(), File::Path::make_path() replaces the
hand-written mkdir idiom, autodie; the three output lines now all
use "label: value" (two lacked the colon)
- New prerequisites: Readonly, Sub::Private (0.09), Sub::Protected (0.03),
autodie, POSIX, File::Path
- Geo::Coder::Free, LWP::UserAgent::Cached and File::HomeDir are needed
only by bin/weather, so they are now "recommends" instead of hard
prerequisites; bin/weather says what to install if one is missing
- The library uses plain "use autodie", so IPC::System::Simple is no
longer a runtime prerequisite
- Licence wording in the POD now agrees with Makefile.PL and LICENSE (GPL2)
- Tests: declare IPC::Run3 and HTTP::Response; add an author test that
checks the code needs no more than Perl 5.10
0.15 Mon Jul 13 12:51:54 EDT 2026
[ Security ]
- Fix SSRF: validate and untaint the host parameter in new() against a
hostname-only regex; rejects IP addresses, @-injection, and path segments
(WEATHER__METEO__host env var was previously accepted verbatim)
- Fix taint-mode compliance: coordinate validation now uses list-context
captures so $latitude/$longitude are untainted before reaching URI/LWP
- Fix ReDoS: replace /^-?\d+(\.\d+)?$/ with atomic-group equivalent
/\A(-?(?>\d+)(?:\.(?>\d+))?)\z/ in all three public data methods and
_normalise_coord(); eliminates O(n) backtracking on adversarial input
- Fix log injection: sanitise $@ from JSON parse failures before carp
(strip control characters, cap at 200 chars)
- Fix path traversal in bin/weather: CACHE_DIR and OPENADDR_HOME env vars
are now untainted via character-class regex and canonicalised with
Cwd::realpath() before any filesystem operation
- Fix TOCTOU race in bin/weather cache directory creation: replaced the
-d check + mkdir pair with atomic mkdir()+EEXIST idiom
[ Enhancements ]
- Add forecast() method using api.open-meteo.com/v1/forecast (1-16 days ahead)
- Add sunrise_sunset() method returning { sunrise, sunset } for any date
- Add sunrise,sunset to weather() daily fields
0.14 Mon Jun 1 08:55:15 EDT 2026
Use Test::Mockingbird instead of Test::MockModule in t/30-basics.t
Fix $self->error() calls that should be $logger->error() in weather()
Fix weather() to guard against UA returning a non-response object
Fix weather() to guard against JSON decoding to a non-hashref
Fix ua(undef) silently corrupting the stored user-agent
Add explicit return at end of weather() when no hourly key is present
Add formal API specification POD (with Z calculus) to new(), weather(), ua()
Added t/function.t, t/unit.t, t/integration.t, t/edge_cases.t
Added t/extended_tests.t targeting coverage gaps
Added t/mutant_killers.t targeting surviving mutants
0.13 Thu Apr 9 07:48:29 EDT 2026
Use Object::Configure to allow runtime configuration
Remove magic numbers
Added test dashboard
Validate the argument given to ua()
0.12 Mon Feb 24 07:44:44 EST 2025
Corrected the documentation for tz
Handle "-0.25" as a co-ordinate
0.11 Fri Feb 14 08:11:25 EST 2025
More useful error message
Handle numbers starting with a decimal point
Added rate-limiting and caching support
0.10 Thu Feb 13 07:47:59 EST 2025
Better handling of JSON decode errors
Added t/30-basics.t
Better arg checking
0.09 Thu May 30 16:27:39 EDT 2024
Attempt to fix https://www.cpantesters.org/cpan/report/cb5e2b52-a699-11ee-9c1e-22106e8775ea
Added t/carp.t
The date argument to weather() can now be a DateTime, or similar, object
Fix giving location as a named argument
0.08 Wed Nov 29 07:08:36 EST 2023
Test needs TimeZone::TimeZoneDB when TIMEZONEDB_KEY is set
Fix https://github.com/nigelhorne/Weather-Meteo/issues/3 (SREZIC)
Fix https://github.com/nigelhorne/Weather-Meteo/issues/4 (SREZIC)
0.07 Thu 9 Nov 07:45:17 EST 2023
Fix http://www.cpantesters.org/cpan/report/b25e6af8-0ce4-11ee-8f82-220d6e8775ea
Carp rather than croak when the website returns 500
0.06 Thu Jun 15 20:49:00 EDT 2023
Added bin/weather
weather() now supports the 'tz' argument
0.05 Fri Apr 14 09:55:47 EDT 2023
Include the daily overview in the results
The database is from 1940
0.04 Tue Mar 21 21:49:03 EDT 2023
Support Geo::Location::Point object to give a location
0.03 Fri Mar 10 09:35:01 EST 2023
Remove unused modules
Look into http://www.cpantesters.org/cpan/report/8b5bb156-bd91-11ed-aba6-9a79f339625c
Fix https://github.com/nigelhorne/Weather-Meteo/issues/1 (SREZIC)
0.02 Tue Feb 28 11:57:35 EST 2023
Remove references left from the template code
Added all my basic testing
0.01 Tue Feb 28 11:16:18 EST 2023
First draft
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
Go to GitHub issues (only if GitHub is preferred repository)