Class: Trackers::Torrentleech

Inherits:
Object
  • Object
show all
Defined in:
lib/torrents/trackers/torrentleech.rb

Instance Method Summary collapse

Instance Method Details

#category_url(type) ⇒ Object



35
36
37
# File 'lib/torrents/trackers/torrentleech.rb', line 35

def category_url(type)
  {:movies => "http://www.torrentleech.org/torrents/browse/index/categories/1,8,9,10,11,12,13,14,15,29/page/<PAGE>"}[type]
end

#details(tr) ⇒ Object



3
4
5
# File 'lib/torrents/trackers/torrentleech.rb', line 3

def details(tr)
  "http://www.torrentleech.org" + tr.at_css(".title a").attr("href")
end

#details_title(details) ⇒ Object



43
44
45
# File 'lib/torrents/trackers/torrentleech.rb', line 43

def details_title(details)
  details.at_css("#torrentTable:nth-child(2) .odd:nth-child(1) td:nth-child(2)").content
end

#details_torrent(details) ⇒ Object



47
48
49
# File 'lib/torrents/trackers/torrentleech.rb', line 47

def details_torrent(details)
  "http://torrentleech.org" + details.css("form[method='get']").last.attr("action")
end

#id(details) ⇒ Object



39
40
41
# File 'lib/torrents/trackers/torrentleech.rb', line 39

def id(details)
  details.match(/\/(\d+)$/).to_a[1]
end

#recent_urlObject



27
28
29
# File 'lib/torrents/trackers/torrentleech.rb', line 27

def recent_url
  "http://www.torrentleech.org/torrents/browse/index/page/<PAGE>"
end

#search_urlObject



23
24
25
# File 'lib/torrents/trackers/torrentleech.rb', line 23

def search_url
  "http://www.torrentleech.org/torrents/browse/index/query/<SEARCH>/page/<PAGE>"
end

#seeders(details) ⇒ Object



15
16
17
# File 'lib/torrents/trackers/torrentleech.rb', line 15

def seeders(details)
  details.to_s.match(/\((\d+) Seeders and \d+ leechers\)/).to_a[1]
end

#start_page_indexObject



31
32
33
# File 'lib/torrents/trackers/torrentleech.rb', line 31

def start_page_index
  1
end

#title(tr) ⇒ Object



11
12
13
# File 'lib/torrents/trackers/torrentleech.rb', line 11

def title(tr)
  tr.at_css(".title a").content
end

#torrent(tr) ⇒ Object



7
8
9
# File 'lib/torrents/trackers/torrentleech.rb', line 7

def torrent(tr)
  "http://www.torrentleech.org" + tr.at_css("td.quickdownload a").attr("href")
end

#torrents(site) ⇒ Object



19
20
21
# File 'lib/torrents/trackers/torrentleech.rb', line 19

def torrents(site)
  site.css("#torrenttable tr")
end