Sha256: a11f566b63280df4c4d55b0240f1fa5af2ddfb3150e9040d53807d3e8e17e294

Contents?: true

Size: 660 Bytes

Versions: 5

Compression:

Stored size: 660 Bytes

Contents

$:.unshift Pathname.new(__FILE__).dirname.join().expand_path.to_s
require 'ArxivApi'
require 'P3'


module ArxivUtil
  BASE_URL = "https://arxiv.org"
  def self.fetchFromUrl(urlName, work_dir, use_dir, use_pdf)
    arxiv = ArxivApi.new(urlName)
    arxiv.references = P3.fetchFromPdfUrl(arxiv.pdfurl, work_dir, use_dir) if use_pdf || use_pdf.nil? 
    return arxiv
  end

  def self.fetchFromArxivId(id, work_dir, use_dir, use_pdf)
    target_url = "#{BASE_URL}/abs/#{id}" 
    fetchFromUrl(target_url, work_dir, use_dir, use_pdf)
  end

  def self.fetchFromPdfUrl(pdfUrl, work_dir, use_dir)
    return P3.fetchFromPdfUrl(pdfUrl, work_dir, use_dir)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arxiv-references-0.1.7.5 lib/arxiv/references/ArxivUtil.rb
arxiv-references-0.1.7.4 lib/arxiv/references/ArxivUtil.rb
arxiv-references-0.1.7.3 lib/arxiv/references/ArxivUtil.rb
arxiv-references-0.1.7.2 lib/arxiv/references/ArxivUtil.rb
arxiv-references-0.1.7.1 lib/arxiv/references/ArxivUtil.rb