INSPEC

 view release on metacpan or  search on metacpan

getCite.pl  view on Meta::CPAN

		if( exists $omits{$key})
		{
			$ret.=$key."=".$cite->{$key}.",\n";
		}
		else
		{
			$ret.=$key."={".$cite->{$key}."},\n";
		}
		}
	}
	$ret =~ s/,$/}/;
	return $ret;
}


### process options
use Getopt::Long;
GetOptions (
  "help!",
  "debug!",
  "dump!",
  "noprescan!",
  "bib=s" => \$::opt_bibfile,
) or die $usage;

### option help
die $usage if $::opt_help;
die $usage if @ARGV == 0 ;

my ($journal,$volume,$page) = @ARGV;
print "Looking up ==> $journal, Vol: $volume, Page: $page  Please Wait..";

%entry = INSPEC::Retriever::retrieve($journal,$volume,$page);

if(! (exists $entry{'ERROR'}) )
{
	print "Done\n";
	%bibtexentry = INSPEC::BibTeX::Inspec_to_BibTeX(\%entry);
	if($::opt_bibfile eq "STDOUT")
	{
		print print_bibtex_citation(\%bibtexentry,"key","type")."\n";
	}
	elsif($::opt_bibfile ne "")
	{
	open(fh,">>".$::opt_bibfile);
	print fh print_bibtex_citation(\%bibtexentry,"key","type")."\n";
	close(fh);
	}
	else
	{
	print "ERROR cant open 	$::opt_bibfile\n";
	}
}
else
{
	print "ERROR!!\n";
	print "Couldn't find the citation in INSPEC databse]--!!\n";
	print "Reasons:\n(1) The citation is too old (i.e older than 1968).\n";
	print "(2) The journal [".$jname."] is not contained in the INSPEC database.\n";
	print "(3) The volume[".$volume."], page number[".$page."], and journal code[".$journal."] were incorrectly specified.\n";
	print "(4) The AXION INPSEC server is down or too busy.  Goto axiom.iop.org/S/ARKAN/search and try a manual search to see.\n";
}



( run in 1.963 second using v1.01-cache-2.11-cpan-5837b0d9d2c )