def sf_eval_uri(uri, exts = [])
      doc = Nokogiri::HTML(open(uri).read)
      doc.encoding, meta = 'utf-8', { uri: uri }

      [:title, :description, :keywords, :lang, :encode, :reply_to, :author].each do |k|
        node = doc.xpath(sf_xpaths[k])[0]
        meta[k] = node.nil? ? '-' : node.text
      end
      meta[:images] = sf_fix_imgs(doc.xpath(sf_xpaths[:image]), uri, exts)

      meta
    rescue SocketError
      {}
    end
def sf_eval_uri(uri, exts = [])
      doc = Nokogiri::HTML(open(uri).read)
      doc.encoding, meta = 'utf-8', { uri: uri }

      [:title, :description, :keywords, :lang, :encode, :reply_to, :author].each do |k|
        node = doc.xpath(sf_xpaths[k])[0]
        meta[k] = node.nil? ? '-' : node.text
      end
      meta[:images] = sf_fix_imgs(doc.xpath(sf_xpaths[:image]), uri, exts)

      meta
    rescue SocketError
      {}
    end
Evaluate the URI's HTML document and get its metadata.

 Example:
   >> eval_uri('http://adtangerine.com', [:png])
   => {
        :title => "AdTangerine | Advertising Platform for Social Media",
        :description => "AdTangerine is an advertising platform that...",
        :images => [
          "http://adtangerine.com/assets/logo_adt_og.png",
          "http://adtangerine.com/assets/logo_adt_og.png
        ],
        :uri => "http://adtangerine.com"
      }
 Arguments:
   uri: (String)
     - URI.
   exts: (Array)
     - Allowed type of images.