Random passage generator
Bee (the person who wrote the framework I use for this site) wrote a program to generate random passages off a reading list (tutorial here, though on her advice, I used the current version of the code here).
It works great, but it's a little difficult to edit because of the complexity of the arrays on which the program runs. I reworked it a bit so it'll be easier for me to edit for my program's updated reading list, which should be coming out this year.
Basically, instead of looking like this:
['homer', 'iliad', [[1, 611], [2, 877], [3, 461], [4, 544], [5, 909], [6, 529], [9, 713], [16, 867], [18, 617], [19, 424], [22, 515], [23, 897], [24, 804]]]
an entry now looks like this:
{
auth: 'homer',
text: 'iliad',
sections: [[1, 611], [2, 877], [3, 461], [4, 544], [5, 909], [6, 529], [9, 713], [16, 867], [18, 617], [19, 424], [22, 515], [23, 897], [24, 804]]
}
The generation code itself is pretty much unchanged, except for places where I substituted, say, i.auth
for i[0]
and some minor edits to the HTML the program creates. Bee' site is doing more complicated things with CSS than mine, so I don't have all the variables and classes she used to style her version.
If you're interested in my version of Bee's code, it's here.