Skip to content
Snippets Groups Projects
Commit e23b6a9b authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

call DOI URLs one by one

parent e1d96896
Branches
No related tags found
No related merge requests found
#!/usr/bin/perl
use strict;
use Data::Dumper;
$Data::Dumper::Indent= 1;
$Data::Dumper::Sortkeys= 1;
use Util::Simple_CSV;
my $fnm= shift(@ARGV);
my @columns= qw(url canonical_url doi identifier);
my $csv= new Util::Simple_CSV (load => $fnm, separator => "\t");
my $data= $csv->{data};
foreach my $row (@$data)
{
print __LINE__, " row: ", Dumper($row);
my ($url, $canonical_url, $doi, $identifier)= map { $row->{$_} } @columns;
$doi= $identifier unless ($doi);
$url= $canonical_url unless ($url);
my $doi_link= 'https://doi.org/'. $doi;
print __LINE__, " doi=[$doi] url=[$url] doi_link=[$doi_link]\n";
# system ('xdg-open', $url);
system ('xdg-open', $doi_link);
<STDIN>;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment