Module: Scopus::URIRequest

Included in:
Connection, Connection
Defined in:
lib/scopus/uri_request.rb

Instance Method Summary collapse

Instance Method Details

#get_uri_abstract(id, type = "scopus_id", opts = {:view=>"FULL"}) ⇒ Object



62
63
64
65
66
67
68
69
70
# File 'lib/scopus/uri_request.rb', line 62

def get_uri_abstract(id,type="scopus_id",opts={:view=>"FULL"})
raise "Type should be a string" unless type.is_a? String
if opts[:view]
  opts_s="view=#{opts[:view]}"
elsif opts[:field]
  opts_s="field=#{opts[:field]}"
end
::URI.encode("https://api.elsevier.com/content/abstract/#{type}/#{id}?apiKey=#{key}&#{opts_s}")
end

#get_uri_articles_country_year_area(country, year, area) ⇒ Object



51
52
53
54
# File 'lib/scopus/uri_request.rb', line 51

def get_uri_articles_country_year_area(country,year,area)
  query="AFFILCOUNTRY ( #{country} )  AND  PUBYEAR  =  #{year}  AND  SUBJAREA ( \"#{area}\" )"
  ::URI.encode("https://api.elsevier.com/content/search/scopus?apiKey=#{key}&sort=artnum&query=#{query}")
end

#get_uri_author(author_id, view = :light, opts = {}) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/scopus/uri_request.rb', line 31

def get_uri_author(author_id,view=:light,opts={})
  if author_id.is_a? (Array)
    author_id=author_id.join(",")
  end
  opts={:view=>view.to_s.upcase}.merge(opts)
  opts_s=opts.map {|v| "#{v[0].to_s}=#{v[1]}"}.join("&")
  res=::URI.encode("https://api.elsevier.com/content/author?author_id=#{author_id}&apiKey=#{key}&#{opts_s}")
  res
end

#get_uri_citation_overview(scopus_id, date, opts = {}) ⇒ Object



40
41
42
43
44
45
46
47
48
49
# File 'lib/scopus/uri_request.rb', line 40

def get_uri_citation_overview(scopus_id,date,opts={})
  if scopus_id.is_a? (Array)
    scopus_id=scopus_id.join(",")
  end
  opts={:date=>date,:field=>"h-index,dc:identifier,scopus_id,pcc,cc,lcc,rangeCount,rowTotal,sort-year,prevColumnHeading,columnHeading,laterColumnHeading,prevColumnTotal,columnTotal,laterColumnTotal,rangeColumnTotal,grandTotal"}.merge(opts)
  opts_s=opts.map {|v| "#{v[0].to_s}=#{v[1]}"}.join("&")
  res=::URI.encode("https://api.elsevier.com/content/abstract/citations?scopus_id=#{scopus_id}&apiKey=#{key}&#{opts_s}")

  res
end

#get_uri_journal_articles(journal, year = nil) ⇒ Object

Get URI to obtain list of articles from a specific journal. You could specify year



57
58
59
60
61
# File 'lib/scopus/uri_request.rb', line 57

def get_uri_journal_articles(journal,year=nil)
query="EXACTSRCTITLE(\"#{journal}\")"
query+=" AND PUBYEAR IS #{year}" if year
::URI.encode("https://api.elsevier.com/content/search/scopus?apiKey=#{key}&query=#{query}")
end