Class: Mangdown::Wiemanga
Instance Attribute Summary
#root
Instance Method Summary
collapse
#is_chapter?, #is_manga?, #is_page?, #manga_chapters, #manga_list, #type
Constructor Details
#initialize(uri, doc) ⇒ Wiemanga
Returns a new instance of Wiemanga.
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/mangdown/adapter/wiemanga.rb', line 5
def initialize(uri, doc)
super
@root = 'http://www.wiemanga.com'
@manga_list_uri =
"#{@root}/search/?name_sel=contain&author_sel=contain" +
"&completed_series=either"
@manga_name_css = '.bookmessagebox h1'
@manga_list_css = 'a.resultbookname'
@chapter_list_css =
'.chapterlist tr:not(:first-child) .col1 a'
@manga_link_prefix = ''
@reverse_chapters = true
@manga_uri_regex = /#{@root}\/manga\/([^\/]+)(\.html)?/i
@chapter_uri_regex =
/#{@root}\/chapter\/([^\/]+)\/(\d+)(\/|\.html)?/i
@page_uri_regex = /.+\.(png|jpg|jpeg)$/i
end
|
Instance Method Details
#build_page_uri(uri, manga, chapter, page_num) ⇒ Object
27
28
29
|
# File 'lib/mangdown/adapter/wiemanga.rb', line 27
def build_page_uri(uri, manga, chapter, page_num)
"#{uri}-#{page_num}.html"
end
|
#manga_name ⇒ Object
23
24
25
|
# File 'lib/mangdown/adapter/wiemanga.rb', line 23
def manga_name
super.sub(/ Manga$/, "")
end
|
#num_pages ⇒ Object
31
32
33
|
# File 'lib/mangdown/adapter/wiemanga.rb', line 31
def num_pages
doc.css('select#page')[0].css('option').length
end
|
#page_image_name ⇒ Object
39
40
41
42
|
# File 'lib/mangdown/adapter/wiemanga.rb', line 39
def page_image_name
doc.css('select#page')[0].css('option[selected]')[0]
.text.rjust(3, '0')
end
|
#page_image_src ⇒ Object
35
36
37
|
# File 'lib/mangdown/adapter/wiemanga.rb', line 35
def page_image_src
page_image[:src]
end
|