-
-
Save mndoci/165003 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# save as pubmed.rb and test using 'ruby pubmed.rb 19662644' | |
# keyword search may return > 1 record due to retmax bug | |
# http://github.com/bioruby/bioruby/commit/51c3223e033b2992a7bd95da282f88164406ff92 | |
# From Neil Saunders http://gist.github.com/164994 | |
require 'rubygems' | |
require 'bio' | |
keywords = ARGV.join(' ') | |
options = { | |
'retmax' => 1 | |
} | |
entries = Bio::PubMed.esearch(keywords, options) | |
entries.each do |entry| | |
query = Bio::PubMed.query(entry) | |
medline = Bio::MEDLINE.new(query) | |
puts medline.reference.bibtex | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment