From 04b437bcbd26480d60e4c514ff32bbeacf8881e7 Mon Sep 17 00:00:00 2001 From: Andinus Date: Thu, 19 Nov 2020 12:18:35 +0530 Subject: Add date to the document --- draco.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/draco.pl b/draco.pl index a926246..6209123 100755 --- a/draco.pl +++ b/draco.pl @@ -6,6 +6,8 @@ use warnings; use HTTP::Tiny; use JSON::MaybeXS; +use POSIX qw(strftime); + # For wrapping comment blocks. use Unicode::LineBreak; my $lb = Unicode::LineBreak->new(ColMax => 76); # Default is 76. @@ -46,6 +48,11 @@ my $post = $json_data->[0]->{data}->{children}->[0]->{data}; # Start the Org document. print "#+", "STARTUP:content\n"; +# Print the date. +my $date = strftime '%+', localtime(); +print "#+", "DATE: $date\n"; +print "\n"; + # Print the post title. print "* ", "$post->{title}\n"; -- cgit 1.4.1-2-gfad0