added more books to be processed
This commit is contained in:
parent
40683f61c1
commit
038bb5e641
33
books.pl
33
books.pl
@ -32,7 +32,7 @@ use DateTime;
|
||||
|
||||
# While these have json formatting, they are JS files
|
||||
my $complete_books_js = "complete_books.js";
|
||||
my $book_pages_js = "book_pages2.js";
|
||||
my $book_pages_js = "book_pages.js";
|
||||
|
||||
# number of lines in a page
|
||||
my $number_of_lines = 31;
|
||||
@ -68,6 +68,34 @@ my @books = (
|
||||
url => "https://www.gutenberg.org/ebooks/121",
|
||||
file => "books/northangerabbey.txt",
|
||||
chapter_marker => "CHAPTER"
|
||||
},
|
||||
{
|
||||
title => "The Picture of Dorian Gray",
|
||||
author => "Oscar Wilde",
|
||||
url => "https://www.gutenberg.org/ebooks/174",
|
||||
file => "books/doriangray.txt",
|
||||
chapter_marker => "CHAPTER"
|
||||
},
|
||||
{
|
||||
title => "The Mysteries of Udolpho",
|
||||
author => "Ann Ward Radcliffe",
|
||||
url => "https://www.gutenberg.org/ebooks/3268",
|
||||
file => "books/udolpho.txt",
|
||||
chapter_marker => "CHAPTER"
|
||||
},
|
||||
{
|
||||
title => "The Enchanted Castle",
|
||||
author => "E. Nesbit",
|
||||
url => "https://www.gutenberg.org/ebooks/34219",
|
||||
file => "books/enchantedcastle.txt",
|
||||
chapter_marker => "CHAPTER"
|
||||
},
|
||||
{
|
||||
title => "Frankenstein",
|
||||
author => "Mary Wollstonecraft Shelley",
|
||||
url => "https://www.gutenberg.org/ebooks/84",
|
||||
file => "books/frankenstein.txt",
|
||||
chapter_marker => "Chapter"
|
||||
}
|
||||
); # books hash
|
||||
|
||||
@ -77,6 +105,7 @@ my $json = new JSON;
|
||||
# Make the books into pages
|
||||
###################################
|
||||
|
||||
# iterate over books
|
||||
my $k = 0;
|
||||
|
||||
foreach (@books) {
|
||||
@ -89,8 +118,10 @@ foreach (@books) {
|
||||
|
||||
# go through each chapter and make pages based on number of desired lines
|
||||
|
||||
#iterate over chapters
|
||||
my $j = 0;
|
||||
my @page_text;
|
||||
|
||||
foreach (@chapters) {
|
||||
|
||||
my @chapter_lines = split(/\r\n/, $chapters[$j]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user