use a single JSON object, include rdap conformance

parent fade57cb
...@@ -33,6 +33,8 @@ if (!-e $dir || !-d $dir) { ...@@ -33,6 +33,8 @@ if (!-e $dir || !-d $dir) {
my $ua = LWP::UserAgent->new('agent' => sprintf('%s/%s', basename(__FILE__, '.pl'), $VERSION)); my $ua = LWP::UserAgent->new('agent' => sprintf('%s/%s', basename(__FILE__, '.pl'), $VERSION));
my $json = JSON->new->pretty;
my $list = join('/', $dir, basename(TLD_LIST)); my $list = join('/', $dir, basename(TLD_LIST));
if (!-e $list || stat($list)->mtime <= time()-86400) { if (!-e $list || stat($list)->mtime <= time()-86400) {
...@@ -108,6 +110,7 @@ foreach my $tld (@tlds) { ...@@ -108,6 +110,7 @@ foreach my $tld (@tlds) {
'ldhName' => $tld, 'ldhName' => $tld,
'handle' => $tld, 'handle' => $tld,
'port43' => WHOIS_HOST, 'port43' => WHOIS_HOST,
'rdapConformance' => [ 'rdap_level_0' ],
}; };
# #
...@@ -314,7 +317,6 @@ foreach my $tld (@tlds) { ...@@ -314,7 +317,6 @@ foreach my $tld (@tlds) {
# write RDAP object to disk # write RDAP object to disk
# #
my $jfile = sprintf('%s/%s.json', $dir, $tld); my $jfile = sprintf('%s/%s.json', $dir, $tld);
my $json = JSON->new->pretty;
if (!write_file($jfile, $json->encode($data))) { if (!write_file($jfile, $json->encode($data))) {
printf(STDERR "Unable to write to '%s': %s\n", $jfile, $!); printf(STDERR "Unable to write to '%s': %s\n", $jfile, $!);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment