use Getopt::Long;
use Pod::Usage;
-use Bio::DB::EUtilities;
+use Bio::DB::SoapEUtilities;
use Encode qw(encode_utf8);
use Term::ANSIColor qw(:constants);
pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
-my $search = Bio::DB::EUtilities->new(-eutil => 'esearch',
- -email => 'don@donarmstrong.com',
- -db => 'pubmed',
- -term => join(' ',@ARGV),
- -retmax => 1000,
- );
-my @ids = $search->get_ids();
+my $fac = Bio::DB::SoapEUtilities->new();
+
+my $result = $fac->esearch(-email => 'don@donarmstrong.com',
+ -db => 'pubmed',
+ -term => join(' ',@ARGV),
+ -retmax => 1000,
+ )->run();
+my @ids = $result->ids;
if ($options{org_mode}) {
print "* Pubmed search results for ".join(' ',@ARGV)." (".scalar(@ids).")\n";
print " + ";
}
print scalar(@ids)." results:\n";
exit 0 unless @ids;
-my $esummary = Bio::DB::EUtilities->new(-eutil => 'efetch',
- -email => 'don@donarmstrong.com',
- -db => 'pubmed',
- -id => \@ids
- );
+my $raw_xml = $fac->efetch(-email => 'don@donarmstrong.com',
+ -db => 'pubmed',
+ -id => \@ids
+ )->run(-raw_xml => 1);
use XML::LibXML;
-my $xml = XML::LibXML->load_xml(string => $esummary->get_Response()->content());
+my $xml = XML::LibXML->load_xml(string => $raw_xml);
for my $article ($xml->findnodes('PubmedArticleSet/PubmedArticle/MedlineCitation')) {
# print $article->toString;
my ($pmid) = $article->findnodes('./PMID');