Class: TorrentFinder::Adapters::DmhyAdapter
- Defined in:
- lib/torrent-finder/adapters/dmhy_adapter.rb
Class Method Summary collapse
-
.name ⇒ Object
name of the adapter.
Instance Method Summary collapse
-
#list(page = 0) ⇒ Object
list recently available torrent.
-
#search(terms) ⇒ Object
search and return available torrent.
Methods inherited from Adapter
Class Method Details
.name ⇒ Object
name of the adapter
10 11 12 |
# File 'lib/torrent-finder/adapters/dmhy_adapter.rb', line 10 def self.name "dmhy" end |
Instance Method Details
#list(page = 0) ⇒ Object
list recently available torrent
15 16 17 18 19 |
# File 'lib/torrent-finder/adapters/dmhy_adapter.rb', line 15 def list(page=0) url = page == 0 ? "http://share.dmhy.org/" : "http://share.dmhy.org/topics/list/page/#{(page+1).to_s}" response = HTTParty.get(url) parse_html(response.body) end |
#search(terms) ⇒ Object
search and return available torrent
22 23 24 25 |
# File 'lib/torrent-finder/adapters/dmhy_adapter.rb', line 22 def search(terms) response = HTTParty.get("http://share.dmhy.org/topics/list", :query => {"keyword" => terms}) parse_html(response.body) end |