Class: Newzleech::NZB
- Inherits:
-
Object
- Object
- Newzleech::NZB
- Defined in:
- lib/sites/newzleech/nzb.rb
Constant Summary collapse
- URL =
'http://www.newzleech.com'
- DAYS_BY_PAGE =
1.7
Instance Attribute Summary collapse
-
#nzbs ⇒ Object
Returns the value of attribute nzbs.
Instance Method Summary collapse
- #download(movie) ⇒ Object
-
#initialize(options = {}) ⇒ NZB
constructor
A new instance of NZB.
Constructor Details
#initialize(options = {}) ⇒ NZB
Returns a new instance of NZB.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sites/newzleech/nzb.rb', line 15 def initialize( = {}) @options = @options[:age] ||= 160 @options[:pages] ||= ((@options[:age].to_f + DAYS_BY_PAGE) / DAYS_BY_PAGE).ceil @nzb_urls = [] @nzbs = [] (1..(@options[:pages].to_i)).each do |page| @nzb_urls << "#{URL}?group=143&minage=&age=160&min=4000&max=max&q=&m=search&adv=1&offset=#{(page.to_i - 1) * 60}" end parse_newzleech end |
Instance Attribute Details
#nzbs ⇒ Object
Returns the value of attribute nzbs.
13 14 15 |
# File 'lib/sites/newzleech/nzb.rb', line 13 def nzbs @nzbs end |
Instance Method Details
#download(movie) ⇒ Object
30 31 32 |
# File 'lib/sites/newzleech/nzb.rb', line 30 def download(movie) open(movie.nzb_link).read end |