Module: SellDotCom

Defined in:
lib/selldotcom.rb,
lib/selldotcom/page.rb,
lib/selldotcom/search.rb,
lib/selldotcom/version.rb

Defined Under Namespace

Classes: Page, Search

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.is_active?(url) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
# File 'lib/selldotcom.rb', line 10

def self.is_active?(url)
  suspended_image_xpath = "//img[@src='http://i.sell.com/i/i_suspend.gif']"
  response = Typhoeus::Request.get(url)
  doc = Nokogiri::HTML(response.body)
  doc.xpath(suspended_image_xpath).count < 1 ? true : false
end