Class: Acme::Smileage::Blog::AmebloDownloader
Constant Summary
Utils::BaseDownloader::DEFAULT_USER_AGENT
Instance Method Summary
collapse
Instance Method Details
#get_entry_body(entry_link) ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/acme/smileage/blog/ameblo_downloader.rb', line 26
def get_entry_body(entry_link)
with_nokogiri(entry_link) do |doc|
Acme::Smileage::Blog::Entry::Body.new {|e|
e.text = parse_text(doc, ".articleText")
e. = parse_attr(doc, ".commentLink", :href)
e.next_entry_link = parse_attr(doc, ".pagingNext", :href)
e.prev_entry_link = parse_attr(doc, ".pagingPrev", :href)
e.image_links = parse_image_list(doc)
e. = (entry_link, doc)
}
end
end
|
#get_entry_list(blog, blog_link, page = 1) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/acme/smileage/blog/ameblo_downloader.rb', line 12
def get_entry_list(blog, blog_link, page=1)
unless blog_link
Acme::Smileage::Blog::Entry::List.new
end
with_nokogiri(blog_link, "entrylist-#{page}.html") do |doc, uri|
Acme::Smileage::Blog::Entry::List.new {|e|
e.link = uri.to_s
e.entries = parse_entry_list(blog, doc)
e.next_page = parse_next_page(doc)
}
end
end
|