app/models/manga_scraper.rb
# grabs manga chapter list from manganelo
grabs manga chapter list from manganelo
grabs manga chapter list from manganelo
def chapters_list(manga_home_page,manga_id)
		chapters_html = open(manga_home_page)
		chapters_doc = Nokogiri::HTML(chapters_html)
		chapters = chapters_doc.css(".chapter-list").css(".row")
		chapters_url_arr = []
		chapters.each do |item|
			chapter_hash = {}
			curr_chapter_url = item.at_css("a").attributes["href"].value 
			chapter_hash[:chapter_url] = curr_chapter_url
			chapter_number = curr_chapter_url.split("_").last.to_i
			chapter_hash[:chapter_number] = chapter_number
			chapter_hash[:manga_id] = manga_id
			 chapters_url_arr << chapter_hash 
		end
		chapters_url_arr
	end
def chapters_list ( manga_home_page , manga_id ) chapters_html = open ( manga_home_page ) chapters_doc = Nokogiri :: HTML ( chapters_html ) chapters = chapters_doc . css ( ".chapter-list" ) . css ( ".row" ) chapters_url_arr = [ ] chapters . each do | item | chapter_hash = { } curr_chapter_url = item . at_css ( "a" ) . attributes [ "href" ] . value chapter_hash [ :chapter_url ] = curr_chapter_url chapter_number = curr_chapter_url . split ( "_" ) . last . to_i chapter_hash [ :chapter_number ] = chapter_number chapter_hash [ :manga_id ] = manga_id chapters_url_arr << chapter_hash end chapters_url_arr end
grabs manga chapter list from manganelo
grabs manga chapter list from manganelo
# logic for finding the chapter number
manga_home_page
<not_specific>
manga_id
<not_specific>