Adds skyward
This commit is contained in:
parent
7ba16ddb9f
commit
9a0a096896
|
@ -1,5 +1,6 @@
|
|||
/wok/*.html
|
||||
/wor/*.html
|
||||
/skyward/*.html
|
||||
/oathbringer/*.html
|
||||
/wok-prime/*.html
|
||||
/edgedancer/*.html
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
require 'fileutils'
|
||||
require 'nokogiri'
|
||||
require_relative './methods'
|
||||
|
||||
FileUtils.mkdir_p('skyward')
|
||||
|
||||
BASE = 'https://www.getunderlined.com'.freeze
|
||||
|
||||
links = [
|
||||
'/read/excerpt-reveal-start-reading-skyward-by-brandon-sanderson/'
|
||||
]
|
||||
|
||||
episode = 1
|
||||
links.each do |link|
|
||||
url = BASE + link
|
||||
puts "Download #{url}"
|
||||
unless File.exist? "skyward/#{episode}.html"
|
||||
`wget --no-clobber "#{url}" --output-document "skyward/#{episode}.html"`
|
||||
end
|
||||
episode += 1
|
||||
end
|
||||
|
||||
html = ''
|
||||
for i in 1..(links.length)
|
||||
complete_html = Nokogiri::HTML(open("skyward/#{i}.html"))
|
||||
page = complete_html.css('article')[0]
|
||||
html += page.inner_html
|
||||
end
|
||||
|
||||
|
||||
File.open('books/skyward.html', 'w') { |file| file.write(html) }
|
||||
puts '[html] Generated HTML file'
|
||||
|
||||
generate('skyward', :all)
|
Loading…
Reference in New Issue