From 8789199b5b5d78b58dad792ee293f14b39f46261 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 13 Dec 2010 21:26:28 +0100 Subject: [PATCH 1/1] browser: record modified date at caniuse retrieval --- tools/convert-caniuse.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/convert-caniuse.pl b/tools/convert-caniuse.pl index 5f619b1..b00a869 100755 --- a/tools/convert-caniuse.pl +++ b/tools/convert-caniuse.pl @@ -28,10 +28,12 @@ if (@ARGV) { my $data = decode_json($res->decoded_content) or die "Parse error: $!"; my $updated = eval { s/ GMT$//, - return Time::Piece->strptime($_)->ymd for $res->header('Last-Modified') - } || time; + return Time::Piece->strptime($_) for $res->header('Last-Modified') + }; + $data->{-date} = $_->datetime for $updated || (); - open my $save, '>', (my $download = "browser-support-$updated.inc.pl"); + my $suffix = $updated && $updated->ymd || time; + open my $save, '>', (my $download = "browser-support-$suffix.inc.pl"); print {$save} pp($data); close $save; -- 2.30.0