Module: Nfler::Page

Defined in:
lib/nfler/page.rb

Overview

NFLer::Page gets the body of an HTML/XML URI

Class Method Summary collapse

Class Method Details

.get(uri) ⇒ String?

Gets the body of an HTML/XML URI

Parameters:

  • URI (String)

    to get

Returns:

  • (String, nil)

    body of the gotten page or nil if something wrong



13
14
15
16
# File 'lib/nfler/page.rb', line 13

def get(uri)
  file = OpenURI.open_uri(uri) rescue nil
  file.read if file
end