Class: Webinfo
- Inherits:
-
Object
- Object
- Webinfo
- Defined in:
- lib/webinfo.rb,
lib/webinfo/version.rb
Constant Summary collapse
- VERSION =
"0.1.2"
Class Method Summary collapse
-
.get_info(addr, options = {}) ⇒ Object
addr - site address options - ,:attr.
Class Method Details
.get_info(addr, options = {}) ⇒ Object
addr - site address options - ,:attr
8 9 10 11 12 13 |
# File 'lib/webinfo.rb', line 8 def self.get_info(addr, = {}) response = HTTParty.get(addr) doc = Nokogiri::HTML(response) nodes = doc.xpath("//#{options[:node]}") nodes.map {|i| i[[:attr]]}.compact.uniq end |