Module: WebStat

Defined in:
lib/web_stat.rb,
lib/web_stat/tag.rb,
lib/web_stat/fetch.rb,
lib/web_stat/errors.rb,
lib/web_stat/version.rb,
lib/web_stat/configure.rb,
lib/web_stat/categorize.rb,
lib/web_stat/fetch/fetch_as_web.rb,
lib/web_stat/fetch/fetch_as_html.rb

Defined Under Namespace

Classes: Categorize, Configure, Fetch, FetchAsHtml, FetchAsWeb, Tag

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Class Method Details

.stat_by_html(html, url = nil) ⇒ Object

Get web page's stat by html

Parameters:

  • String —

    html

  • url (String) (defaults to: nil)


38
39
40
41
42
# File 'lib/web_stat.rb', line 38

def stat_by_html(html, url=nil)
  web_stat = WebStat::FetchAsHtml.new(html)
  web_stat.url = url unless url.nil?
  web_stat.stat
end

.stat_by_url(url) ⇒ Object

Get web page's stat by url

Parameters:

  • String —

    url



31
32
33
# File 'lib/web_stat.rb', line 31

def stat_by_url(url)
  stat_by_web(url)
end

.stat_by_web(url) ⇒ Object

Get web page's stat by url



24
25
26
27
# File 'lib/web_stat.rb', line 24

def stat_by_web(url)
  web_stat = WebStat::FetchAsWeb.new(url)
  web_stat.stat
end