Module: SeriesTimer::Crawler

Defined in:
lib/series_timer/crawler.rb

Constant Summary collapse

REGEX_EPISODES =
/<td>(\d+)<\/td>[^<]+<td[^>]+>"(?:<b><a[^>]+>|<b>|<a[^>]+>)?([^<]*)(?:<\/a><\/b>|<\/b>|<\/a>)?".*?<span[^>]+>([0-9-]+)<\/span>/m
CACHE_DIR =
File.join(File.dirname(__FILE__), '../../cache/')

Class Method Summary collapse

Class Method Details

.get_episodes(serie, options) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/series_timer/crawler.rb', line 10

def get_episodes(serie, options)
  if options == :force
    web(serie)
  else
    File.exists?(get_cache_file(serie)) ? cache(serie) : web(serie)
  end
end