Permalink
Browse files

Due to the space in 'Chemical blogspace' the curl command in search_p…

…ubmed_doi always failed. Now, thanks to the magic of CGI::escape, this is not a problem. PMIDs will now be retrieved...this should improve the metadata.

git-svn-id: https://blueobelisk.svn.sf.net/svnroot/blueobelisk/cb/trunk@62 d3c5a50b-8e31-0410-8099-a759d7a8ce2e
  • Loading branch information...
1 parent aad19a7 commit 8fa9666e8f96e32a708f1145f6d0b5fafaecfbbc baoilleach committed Jul 5, 2007
Showing with 2 additions and 1 deletion.
  1. +2 −1 helper.pm
View
3 helper.pm
@@ -10,6 +10,7 @@ package helper;
use lib (".");
use strict;
use DBI;
+use CGI;
use config qw(%config urlencode log log_error do_sleep urldecode $DEBUG parse_post_xml url_breakdown trim);
use XML::Simple;
@@ -189,7 +190,7 @@ sub download_url {
sub search_pubmed {
my $text = urlencode("\"".$_[0]."\"");
- my $search_url = sprintf("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&tool=%s&email=%s&term=%s", $config{"name"}, $config{"email"}, $text);
+ my $search_url = sprintf("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&tool=%s&email=%s&term=%s", CGI::escape($config{"name"}), $config{"email"}, $text);
my $agent = $config{"user_agent"};
my $results = `curl -s -L -m 30 -A "$agent" '$search_url'`;

0 comments on commit 8fa9666

Please sign in to comment.