class Google::Scholar::Author

Public Class Methods

new(document) click to toggle source
# File lib/google/scholar/author.rb, line 5
def initialize(document)
  @summary_doc = document
end

Public Instance Methods

articles() click to toggle source
# File lib/google/scholar/author.rb, line 26
def articles
  @articles ||= Google::Scholar::ArticleEnumerator.new(Google::Scholar::Scraper.new(nil,self.full_profile))
end
author_url() click to toggle source
# File lib/google/scholar/author.rb, line 14
def author_url
  @author_url ||= "#{Google::Scholar.google_url}#{@summary_doc.css("td:last a").first.attr("href")}&pagesize=100"
end
citation_count() click to toggle source
# File lib/google/scholar/author.rb, line 11
def citation_count
  @citation_count ||= @summary_doc.css("td:last").children.reject{|x| !x.text?}.last.text.split(" ").last.to_i
end
citations() click to toggle source
# File lib/google/scholar/author.rb, line 20
def citations
  full_profile.css("#stats td.cit-data").first.text.to_i
end
full_profile() click to toggle source
# File lib/google/scholar/author.rb, line 17
def full_profile
  @full_profile ||= Google::Scholar::Scraper.new(author_url).documents.first
end
id() click to toggle source
# File lib/google/scholar/author.rb, line 23
def id
  @id ||= @summary_doc.css("td:last a:first").attr("href").to_s.match(/user=(.*)&/)[1]
end
name() click to toggle source
# File lib/google/scholar/author.rb, line 8
def name
  @name ||= @summary_doc.css("td:last a:first").text.strip.gsub('\n','')
end