Class: Bremen::Nicovideo
- Inherits:
-
Base
- Object
- Base
- Bremen::Nicovideo
show all
- Defined in:
- lib/bremen/nicovideo.rb
Constant Summary
collapse
- BASE_URL =
'http://www.nicovideo.jp/'
Instance Attribute Summary
Attributes included from Track
#author, #created_at, #length, #thumbnail_url, #title, #uid, #updated_at, #url
Class Method Summary
collapse
Methods inherited from Base
find, search
Methods included from Request
#build_query, #get
Methods included from Track
#initialize
Class Method Details
.find_url(uid_or_url) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/bremen/nicovideo.rb', line 17
def find_url uid_or_url
unless uid_or_url.include?('www.nicovideo.jp')
"#{BASE_URL}watch/#{uid_or_url}"
else
uid_or_url
end
end
|
.search_url(options = {}) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/bremen/nicovideo.rb', line 25
def search_url options = {}
options = default_options.merge(options)
query = {
sort: options[:sort],
order: options[:order],
f_range: options[:within],
l_range: options[:length],
opt_md: options[:downloadable],
}
"#{BASE_URL}search/#{CGI.escape(options[:keyword])}?#{build_query(query)}"
end
|