Class: Trackers::Tti
- Inherits:
-
Object
- Object
- Trackers::Tti
- Defined in:
- lib/torrents/trackers/tti.rb
Instance Method Summary collapse
- #category_url(type) ⇒ Object
- #details(tr) ⇒ Object
- #details_title(details) ⇒ Object
- #details_torrent(details) ⇒ Object
- #id(details) ⇒ Object
- #recent_url ⇒ Object
- #search_url ⇒ Object
- #seeders(details) ⇒ Object
- #start_page_index ⇒ Object
- #title(tr) ⇒ Object
- #torrent(tr) ⇒ Object
- #torrents(site) ⇒ Object
Instance Method Details
#category_url(type) ⇒ Object
35 36 37 |
# File 'lib/torrents/trackers/tti.rb', line 35 def category_url(type) {:movies => "http://tti.nu/browse.php?c47=1&c65=1&c59=1&c48=1&page=<PAGE>&incldead=0"}[type] end |
#details(tr) ⇒ Object
3 4 5 |
# File 'lib/torrents/trackers/tti.rb', line 3 def details(tr) "http://tti.nu/" + tr.to_s.match(/(details\.php\?id=\d+)/i).to_a[1] end |
#details_title(details) ⇒ Object
43 44 45 |
# File 'lib/torrents/trackers/tti.rb', line 43 def details_title(details) details.at_css("h1").content end |
#details_torrent(details) ⇒ Object
47 48 49 |
# File 'lib/torrents/trackers/tti.rb', line 47 def details_torrent(details) "http://tti.nu/" + details.css("tr a").reject { |link| ! link.attr("href").to_s.match(/\.torrent/) }.first.attr("href") end |
#id(details) ⇒ Object
39 40 41 |
# File 'lib/torrents/trackers/tti.rb', line 39 def id(details) details.match(/id=(\d+)/).to_a[1] end |
#recent_url ⇒ Object
27 28 29 |
# File 'lib/torrents/trackers/tti.rb', line 27 def recent_url "http://tti.nu/browse.php?page=<PAGE>&incldead=0" end |
#search_url ⇒ Object
23 24 25 |
# File 'lib/torrents/trackers/tti.rb', line 23 def search_url "http://tti.nu/browse.php?search=<SEARCH>&page=<PAGE>&incldead=0" end |
#seeders(details) ⇒ Object
15 16 17 |
# File 'lib/torrents/trackers/tti.rb', line 15 def seeders(details) details.to_s.match(/(\d+) seeder\(s\)\,/).to_a[1] end |
#start_page_index ⇒ Object
31 32 33 |
# File 'lib/torrents/trackers/tti.rb', line 31 def start_page_index 0 end |
#title(tr) ⇒ Object
11 12 13 |
# File 'lib/torrents/trackers/tti.rb', line 11 def title(tr) tr.at_css('td:nth-child(2) b').content.gsub(/\.\.\.$/, "") end |
#torrent(tr) ⇒ Object
7 8 9 |
# File 'lib/torrents/trackers/tti.rb', line 7 def torrent(tr) "http://tti.nu" + tr.at_css('.direct_download a').attr('href') end |
#torrents(site) ⇒ Object
19 20 21 |
# File 'lib/torrents/trackers/tti.rb', line 19 def torrents(site) site.css('table[border="0"] tr') end |