Skip to content

Instantly share code, notes, and snippets.

@pn11
Last active Jun 29, 2016
Embed
What would you like to do?
素粒子・宇宙系の雑誌名、号数、ページ数からURLを生成。Macのopenでブラウザに飛ばす。Moved to -> https://github.com/pn11/OkaScripts/tree/master/src/research#search_article
#!/usr/bin/ruby
if ARGV.size == 3
journal=ARGV[0]
volume=ARGV[1]
page=ARGV[2]
elsif ARGV.size == 2
journal=ARGV[0]
page=ARGV[1]
else
puts "Number of Argument is wrong. Use like this:"
puts "./search_article.rb prl 81 1562"
exit
end
# ./program journal volume page
# Physical Review Letters
if /PRL/i =~ journal then
volume = volume.to_i
pgage = page.to_i
puts "Physical Review Letters, Volume #{volume}, pp. #{page} searched."
puts
url= "http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.#{volume}.#{page}"
puts url
`open \"#{url}\"`
# Physical Review Letters D
elsif /PRD/i =~ journal then
volume = volme.to_i
page = page.to_i
page = "%06d" % page
puts "Physical Review Letters, Volume #{volume}, pp. #{page} searched."
puts ""
url = "http://journals.aps.org/prd/abstract/10.1103/PhysRevD.90.073009"
puts url
`open \"#{url}\"`
# Astrophysical Journal
elsif /APJ/i =~ journal then
volume = volume.to_i
vpage = page.to_i
puts "Astrophysical Journal, Volume #{volume}, pp. #{page} searched."
puts
url = "http://iopscience.iop.org/findcontent?CF_JOURNAL=0004-637X&CF_VOLUME=#{volume}&CF_PAGE=#{page}&submit=Find+article&navsubmit=Find+article"
puts url
`open \"#{url}\"`
# Progress of Theoretical and Experimental Physics
elsif /PTEP/i =~ journal then
page = "063C01"
puts "Progress of Theoretical and Experimental Physics, #{page} searched."
puts
url = "http://ptep.oxfordjournals.org/search?submit=Search&firstpage=#{page}"
puts url
`open \"#{url}\"`
else
puts "Jounal not found. Available journal is"
puts "PRL: Physical Review Letters"
puts "PRD: Physical Review Letters D"
puts "Apj: Astrophysical Journal"
puts "PTEP: Progress of Theoretical and Experimental Physics"
end

Moved to https://github.com/pn11/OkaScripts/tree/master/src/research#search_article

##検索できる雑誌

  • PRL
  • PRD
  • Apj
  • PTEP

##使用例

./search_article.rb ptep 063C01
./search_article.rb prl 81 1562

##そのうち追加したい雑誌

  • arXiv
  • EPJC
  • Science
  • Nature

##追加したいけどできなそうな雑誌 エルゼビアのはDOIが日付だし、URLもよくわかんない。

  • NIM A
  • Nuc. Phys. B
  • PLB
  • Astroparticle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment