Skip to content

Commit

Permalink
Merge pull request #145 from sul-dlss/pubmedclient-fix
Browse files Browse the repository at this point in the history
use pubmed client when looking up records at pubmed to ensure HTTPS c…
  • Loading branch information
Darren Hardy authored Nov 10, 2016
2 parents 2e60914 + ac31d29 commit f480952
Show file tree
Hide file tree
Showing 17 changed files with 8,565 additions and 6 deletions.
7 changes: 1 addition & 6 deletions app/models/pubmed_source_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@ def self.create_pubmed_source_record(pmid, pub_doc)

def self.get_and_store_records_from_pubmed(pmids)
pmidValuesForPost = pmids.collect { |pmid| "&id=#{pmid}" }.join
http = Net::HTTP.new('eutils.ncbi.nlm.nih.gov')
request = Net::HTTP::Post.new('/entrez/eutils/efetch.fcgi?db=pubmed&retmode=xml')
request.body = pmidValuesForPost
the_incoming_xml = PubmedClient.new.fetch_records_for_pmid_list pmidValuesForPost

# http.start
the_incoming_xml = http.request(request).body
# http.finish
count = 0
source_records = []
Nokogiri::XML(the_incoming_xml).xpath('//PubmedArticle').each do |pub_doc|
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f480952

Please sign in to comment.