parent
94aa6de86e
commit
a802dd86e0
|
@ -18,7 +18,7 @@ links = [
|
|||
'2017/10/12/edgedancer-reread-chapters-13-and-14/',
|
||||
'2017/10/19/edgedancer-reread-chapters-15-and-16/',
|
||||
'2017/10/26/edgedancer-reread-chapters-17-and-18/',
|
||||
'2017/11/02/edgedancer-reread-chapters-19-and-20/',
|
||||
'2017/11/02/edgedancer-reread-chapters-19-and-20/'
|
||||
]
|
||||
|
||||
episode = 1
|
||||
|
@ -34,7 +34,7 @@ end
|
|||
|
||||
# Now we have all the files
|
||||
html = ''
|
||||
for i in 1..(links.length)
|
||||
(1..(links.length)).each do |i|
|
||||
complete_html = Nokogiri::HTML(open("edgedancer/#{i}.html"))
|
||||
page = complete_html.css('.entry-content')
|
||||
title = complete_html.css('.entry-title>a').inner_html
|
||||
|
|
12
methods.rb
12
methods.rb
|
@ -20,12 +20,12 @@ end
|
|||
def command?(cmd)
|
||||
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
||||
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
||||
exts.each { |ext|
|
||||
exts.each do |ext|
|
||||
exe = File.join(path, "#{cmd}#{ext}")
|
||||
return exe if File.executable?(exe) && !File.directory?(exe)
|
||||
}
|
||||
end
|
||||
end
|
||||
return nil
|
||||
nil
|
||||
end
|
||||
|
||||
def commands?(commands)
|
||||
|
@ -38,6 +38,7 @@ end
|
|||
|
||||
def gen_epub(name, format)
|
||||
return unless format_match(format, :epub)
|
||||
|
||||
begin
|
||||
require 'paru/pandoc'
|
||||
Paru::Pandoc.new do
|
||||
|
@ -64,10 +65,9 @@ def gen_mobi(name, format)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
def inside_docker?
|
||||
File.readlines("/proc/1/sched").each do |line|
|
||||
return line.strip != "systemd (1, #threads: 1)"
|
||||
File.readlines('/proc/1/sched').each do |line|
|
||||
return line.strip != 'systemd (1, #threads: 1)'
|
||||
end
|
||||
rescue Errno::ENOENT => e
|
||||
false
|
||||
|
|
|
@ -60,6 +60,7 @@ links = [
|
|||
"/2019/01/17/oathbringer-reread-chapter-sixty-one/",
|
||||
"/2019/01/24/oathbringer-reread-chapter-sixty-two/",
|
||||
"/2019/01/31/oathbringer-reread-chapter-sixty-three/",
|
||||
"/2019/02/07/oathbringer-reread-chapter-sixty-four/"
|
||||
]
|
||||
|
||||
episode = 1
|
||||
|
|
|
@ -21,7 +21,7 @@ loop do
|
|||
month = links.last.split('/').first
|
||||
day = links.last.split('/')[1]
|
||||
next_date = Date.new(2017, month.to_i, day.to_i) + 7
|
||||
ending_chapter = [chapter+2, 32].min
|
||||
ending_chapter = [chapter + 2, 32].min
|
||||
links << "#{next_date.strftime('%m')}/#{next_date.strftime('%d')}/oathbringer-by-brandon-sanderson-chapters-#{chapter}-#{ending_chapter}/"
|
||||
chapter += 3
|
||||
break if next_date + 7 > Date.today
|
||||
|
|
|
@ -21,13 +21,12 @@ links.each do |link|
|
|||
end
|
||||
|
||||
html = '<title>Skyward</title>'
|
||||
for i in 1..(links.length)
|
||||
(1..(links.length)).each do |i|
|
||||
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'
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ links.each do |link|
|
|||
end
|
||||
|
||||
html = ''
|
||||
for i in 1..(links.length)
|
||||
(1..(links.length)).each do |i|
|
||||
complete_html = Nokogiri::HTML(open("wok-prime/#{i}.html"))
|
||||
page = complete_html.css('article')[0]
|
||||
|
||||
|
|
Loading…
Reference in New Issue