Class: Parody
Class Method Summary collapse
-
.listing(keyword, sort = 1, page = 1) ⇒ Object
List all doujinshi of the page of a given parody.
Methods inherited from Tag
Class Method Details
.listing(keyword, sort = 1, page = 1) ⇒ Object
List all doujinshi of the page of a given parody
450 451 452 453 454 455 456 457 |
# File 'lib/nhentai-api.rb', line 450 def self.listing(keyword, sort = 1, page = 1) keyword.tr!(' ', '-') sort = sort == 1 ? '' : 'popular' client = Net::HTTP.get_response(URI("https://nhentai.net/parody/#{keyword}/#{sort}?page=#{page}")) res = client.body.split(%r{<div class="gallery".+?>(.+)</div>}).select { |line| line.include?('<a href="/g/') } (res) end |