Skip to content

Commit

Permalink
use eutils url for pubmed scraping
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Jun 20, 2017
1 parent fd86310 commit 726dc52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/scrapers/pub_med.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def self.call_pubmed_api(pubmed_id)

private
def self.url_for_pubmed_id(pubmed_id)
"https://www.ncbi.nlm.nih.gov/pubmed/#{pubmed_id}?report=xml&format=text"
"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=#{pubmed_id}&retmode=xml"
end
end
end
2 changes: 1 addition & 1 deletion lib/scrapers/pub_med_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Scrapers
class PubMedResponse
attr_reader :xml
def initialize(response_body)
@xml = Nokogiri::XML(Nokogiri::XML(response_body).text)
@xml = Nokogiri::XML(response_body)
end

def citation
Expand Down

0 comments on commit 726dc52

Please sign in to comment.