Class: Saber::Tracker::STP

Inherits:
Gazelle show all
Defined in:
lib/saber/tracker/stp.rb

Constant Summary collapse

BASE_URL =
"https://stopthepress.es"
LOGIN_CHECK_PATH =
"/inbox.php"

Constants inherited from Gazelle

Gazelle::TAG_MAP

Constants inherited from Base

Base::DELEGATE_METHODS, Base::POPULATE_TYPES

Instance Attribute Summary

Attributes inherited from Base

#agent, #name, #options

Instance Method Summary collapse

Methods inherited from Gazelle

#convert_tags

Methods inherited from Base

can_populate?, inherited, #initialize, #login, #populate, #upload

Constructor Details

This class inherits a constructor from Saber::Tracker::Base

Instance Method Details

#exists?(o = {}) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/saber/tracker/stp.rb', line 7

def exists?(o={})
  url = "/torrents.php?cataloguenumber=#{o[:isbn]}"
  page = agent.get(url)

  not page.at("//*[@id='content']/div[2]/h2[contains(text(), 'Your search did not match anything.')]")
end