mirror of
https://github.com/captn3m0/cosmere-books.git
synced 2024-09-27 19:23:03 +00:00
Adds Chapter 9
This commit is contained in:
parent
bc6b1d05b3
commit
65f64e9565
19
row.rb
19
row.rb
@ -16,26 +16,11 @@ links = [
|
|||||||
'08/11/read-rhythm-of-war-by-brandon-sanderson-chapter-six/',
|
'08/11/read-rhythm-of-war-by-brandon-sanderson-chapter-six/',
|
||||||
'08/18/read-rhythm-of-war-by-brandon-sanderson-chapter-seven/',
|
'08/18/read-rhythm-of-war-by-brandon-sanderson-chapter-seven/',
|
||||||
'08/25/read-rhythm-of-war-by-brandon-sanderson-chapter-eight/',
|
'08/25/read-rhythm-of-war-by-brandon-sanderson-chapter-eight/',
|
||||||
|
'09/01/read-rhythm-of-war-by-brandon-sanderson-chapter-nine/'
|
||||||
]
|
]
|
||||||
|
|
||||||
# Automatically adds all recent chapters
|
# Automatically adds all recent chapters
|
||||||
puts 'Downloading all found links'
|
puts 'Downloading all found links'
|
||||||
chapter = 5
|
|
||||||
next_date = Date.new(1970, 1, 1)
|
|
||||||
loop do
|
|
||||||
links.last.split('/')
|
|
||||||
month = links.last.split('/').first
|
|
||||||
day = links.last.split('/')[1]
|
|
||||||
next_date = Date.new(2020, month.to_i, day.to_i) + 7
|
|
||||||
break if next_date > Date.today
|
|
||||||
|
|
||||||
ending_chapter = [chapter + 2, 32].min
|
|
||||||
links << "#{next_date.strftime('%m')}/#{next_date.strftime('%d')}/read-rhythm-of-war-by-brandon-sanderson-chapters-#{chapter}-#{ending_chapter}/"
|
|
||||||
chapter += 3
|
|
||||||
break if next_date + 7 > Date.today
|
|
||||||
end
|
|
||||||
next_date += 7
|
|
||||||
|
|
||||||
episode = 1
|
episode = 1
|
||||||
|
|
||||||
links.each do |link|
|
links.each do |link|
|
||||||
@ -70,8 +55,6 @@ html = ''
|
|||||||
url = BASE + links[i - 1]
|
url = BASE + links[i - 1]
|
||||||
end
|
end
|
||||||
|
|
||||||
html += "<p>Next chapter out on #{next_date}</p>"
|
|
||||||
|
|
||||||
$annotations.each_with_index do |a, i|
|
$annotations.each_with_index do |a, i|
|
||||||
if a
|
if a
|
||||||
html += "<h1 id='annotation-#{i}'>Annotations - " + links[i].split('/').last[40..] + "</h1>"
|
html += "<h1 id='annotation-#{i}'>Annotations - " + links[i].split('/').last[40..] + "</h1>"
|
||||||
|
Loading…
Reference in New Issue
Block a user