Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Please sign up or log in to edit the wiki.

Create the functionality to cycle through quotes on a daily/weekly/monthly basis automatically.

Do this by:

  1. Creating a function which takes the day of the year, and finds the remainder upon division by 7.
  2. The result is then used to select quotes from any of the 7 pages listed here (excluding "The Lord of the Rings/Quotations", since quotes for each book are contained in pages for each individual book). The 7 pages making up the "quote bank" are:
 * J.R.R. Tolkien/Quotations
 * The Hobbit/Quotations
 * The Fellowship of the Ring/Quotations
 * The Two Towers/Quotations
 * The Return of the King/Quotations
 * The Lord of the Rings Appendices/Quotations
 * The Silmarillion/Quotations

The end result of this should be that on day 0 (whatever day January 1st is - assume Wednesday as an example), a random quote by J.R.R. Tolkien will be shown (first in the list above). Then on Thursday, a random quote from The Hobbit (second in the list above) will be shown, and so on, until Tuesday, when a random quote from The Silmarillion (last in the list above) will be shown. Once we get back to Wednesday, the process will repeat, but with a randomly selected quote from each page each day. This can be modified to be weekly, but currently testing it as a daily change.







172

4


https://tolkiengateway.net/wiki/The_Return_of_the_King/Quotations


'Sleep again, and do not be afraid!' said Gandalf. 'For you are not going like Frodo to Mordor, but to Minas Tirith, and there you will be as safe as you can be anywhere in these days. If Gondor falls, or the Ring is taken, then the Shire will be no refuge.'

'We will come', said Imrahil; and they parted with courteous words.
'That is a fair lord and a great captain of men,' said Legolas. 'If Gondor has such men still in these days of fading, great must have been its glory in the days of its rising.'
'And doubtless the good stone-work is the older and was wrought in the first building,' said Gimli. 'It is ever so with the things that Men begin: there is a frost in Spring, or a blight in Summer, and they fail of their promise.'
'Yet seldom do they fail of their seed,' said Legolas. 'And that will lie in the dust and rot to spring up again in times and places unlooked-for. The deeds of Men will outlast us, Gimli.'
'And yet come to naught in the end but might-have-beens, I guess,' said the Dwarf.
'To that the Elves know not the answer,' said Legolas.

Well, here at last, dear friends, on the shores of the sea comes the end of our fellowship in Middle-earth. Go in peace! I will not say: do not weep for not all tears are an evil.


Length of The Silmarillion/Quotations page is 1728 characters.