Module: DList::List::Bot
- Defined in:
- lib/dblista/list/bot.rb
Overview
Bot lists
Class Method Summary collapse
-
.all ⇒ Array
Fetches all bots.
-
.premium(page = 0, limit = 10) ⇒ Hash
Fetches premium bots.
-
.rejected ⇒ Hash
Fetches rejected bots.
-
.search(query) ⇒ Hash
Bot search.
-
.top(page = 0, limit = 10) ⇒ Hash
Fetches top bots.
-
.unverified ⇒ Hash
Fetches unverified bots.
Class Method Details
.all ⇒ Array
Fetches all bots
62 63 64 65 66 |
# File 'lib/dblista/list/bot.rb', line 62 def self.all DList._cache(:botsall) do DList._get('/bots/list/top/0?limit=1000000') end end |
.premium(page = 0, limit = 10) ⇒ Hash
Fetches premium bots
33 34 35 36 37 38 39 |
# File 'lib/dblista/list/bot.rb', line 33 def self.premium(page = 0, limit = 10) DList._page_integer page DList._limit_integer limit DList._cache("botspremium#{page}-#{limit}") do DList._get("/bots/list/premium/#{page}?limit=#{limit}") end end |
.rejected ⇒ Hash
Fetches rejected bots
53 54 55 56 57 |
# File 'lib/dblista/list/bot.rb', line 53 def self.rejected DList._cache(:botsrejected) do DList._get('/bots/list/rejected') end end |
.search(query) ⇒ Hash
Bot search
72 73 74 75 76 77 78 |
# File 'lib/dblista/list/bot.rb', line 72 def self.search(query) raise DList::Error, DList::Errors::QUERY_NOT_PROVIDED unless query DList._cache("botsearch#{query}") do DList._get("/bots/search/#{CGI.escape query.to_s}") end end |
.top(page = 0, limit = 10) ⇒ Hash
Fetches top bots
20 21 22 23 24 25 26 |
# File 'lib/dblista/list/bot.rb', line 20 def self.top(page = 0, limit = 10) DList._page_integer page DList._limit_integer limit DList._cache("botstop#{page}-#{limit}") do DList._get("/bots/list/top/#{page}?limit=#{limit}") end end |