Veronica's miscellaney

bits that don't fit into my proper web page

Officium Divinum on an ebook reader

with 9 comments

BooksIf you want an easy way to put the Divine Office or Liturgy of the Hours on an ebook reader see Universalis. You can read it online. They even have standalone software for Windows and Mac. You can try it for free for a month before you buy a registration code.

The program takes all the hassle of figuring out what to read for the day – it’s all sorted out by computer. The program spits out an ebook to take you through the week with the hours plus the Office of Readings.

All normal people happy with Novus Ordo liturgical things and proprietary operating systems can stop reading there.

The rest of the post describes the sort of complications that make it worth posting about.

For starters, Universalis doesn’t run properly under Linux. Wine doesn’t quite handle the graphical user interface, though it does generate an ebook. Also it uses the modern Liturgy of the Hours, which is great. It spreads out the psalms over a 4 week cycle – which is why you need a computer to keep track of which week it is! My soft spot for the traditional Latin Mass and the Douay Rheims Bible casts a rosy glow over the older Divine Office which gets all the psalms in just one week. Also my Free Open Source Software side baulks at the thought of paying for software – Universalis uses contemporary translations which require royalty payments.

Enter Divinum Officium. A free, open source program written in Perl which generates html versions of the hours according to whichever version of the pre Vatican II office you choose. From Pre-Tridentine Monastic to 1960, in Latin, English and/or Magyar.

The next step was getting the web pages onto my ebook reader. Next piece of the puzzle is Calibre – an open source ebook manager program which converts books between different formats.

My ebook reader only reads epub. It also reads pdfs, but is not so easy to navigate. Epub is basically a zipped up webpage. Html is supposed to be one of the easiest formats to make into an epub ebook.

Unfortunately Calibre had a hard time with Divinum Officium’s output. The webpages are formatted with tables and Kobo doesn’t handle tables very well. It won’t break them over a page so only the first page of each chapter is visible. It needed some tidying up.

UPDATE: Divinum Officium has been updated and now can produce html that Calibre can digest into good epubs that look great on my Kobo Reader – even with two columns!

With “Learning Perl” in one hand and a piece of paper in the other I managed to make up a script to strip the table tags. At the risk of losing all credibility as a programmer here’s my first perl program. I call it cleanup.pl. NOTA BENE: This code is now quite unnecessary with the new updated Divinum Officium, but I leave it here so the article makes sense.


#!/usr/bin/perl
## Here goes nothing!
## Made obsolete by the June 2011 update to Divinum Officium

$aday = "8-31";

opendir(ADAY,"$aday/") || die "can't open $aday";

while ($name = readdir(ADAY)){
print "$name\n";
$newname = $name;
if ($name eq '.'){
print "found a dot";
} elsif ($name eq '..') {
print "found two!;"
} else {

open(IN,"$aday/$name") || die "can't open $aday/$name";
open(OUT,">out/$name") || die "can't open out/$name for writing";
while ($line = ){
$line =~ s/<\/?(TR|TD|TABLE)[^>]*>//;
$line =~ s/<TD[^>]*>//;
$line =~ s/<BODY[^>]*>/<body>/;
print OUT $line;
}
close(IN);
close(OUT);
}
}

closedir(ADAY);

open(IN,"Master-$aday.html") || die "can't open Master-$aday.html";
open(OUT,">Hours-$aday.html") || die "can't open Hours-$aday.html to write";
while ($line = ){
$line =~ s/<\/?(TR|TD|TABLE)[^>]*>//;
$line =~ s/<\/?(TR|TD|TABLE)[^>]*>//;
$line =~ s/<\/?(TR|TD|TABLE)[^>]*>//;
$line =~ s/$aday/out/;
$line =~ s/Master-out/Hours-$aday/;
print OUT $line;
}
print "That's Hours-$aday.html done!\n";
close(IN);
close(OUT);

Divinum Officium can generate lots of days at a time. Then for each day I edit cleanup.pl and change the $aday. The output is still rather rough with lots of deprecated FONT tags so I use Tidy from the World Wide Web consortium with this config file:


// Tidy configuration for converting to xml
output-xhtml: yes
add-xml-decl: no
doctype: strict
indent: auto
wrap: 76
clean: yes
bare: yes

Then call up Calibre to add the file Hours-8-31.html as a book. Then convert the book to epub. Then send the book to the Kobo.

UPDATE: Now I just cd into the Hofficium/officiumprog/ directory and type “perl LHofficium.pl” then note the tips for “Nook and Kindle” that appear in the lower part of the window. I generate the files and then open up Calibre to add the “books” and convert to epub and send to the Kobo as per usual. No scripting required.

Or buy Windows and an Universalis registration code – but where’s the fun in that?

Laszlo Kiss, the creator of divinumofficium.com, died unexpectedly but peacefully at his home on July 11, 2011. He was a few days short of his 73rd birthday.

Requiescat in pace.

About these ads

Written by Veronica Brandt

27 August, 2010 at 3:37 pm

Posted in prayer, Reading

Tagged with , , , ,

9 Responses

Subscribe to comments with RSS.

  1. It is wonderful to see you discovering for yourself divinumofficium.com, and making the most of this treasure. I indeed use the site very regularly myself… Personally I now use the HTML generated files I create on my Nokia N900 (Maemo5-based), and also did so on a Nokia N95 as well! :-)

    Very nice post! God bless you and yours, David.

    IntroiboAdAltareDei

    27 August, 2010 at 9:10 pm

    • God bless you and yours too, David. Good to hear others using the site too. Next I want to write about classicalliberalarts.com, the website that sparked my renewed interest in the Divine Office.

      veromarybrrr

      28 August, 2010 at 3:45 pm

  2. Since PHP is closer to my native tongue I decided to translate and upgrade:

    http://pastebin.com/iaJZu1bG

    1. Place script in directory you have output do. files to.
    2. Either run the script (converts whole directory) or pass in a list of dates (converts only those dates)
    3. Point Callibre at the newly created index file.

    Christopher Allen-Poole

    30 July, 2011 at 7:57 am

    • Thanks for that. I haven’t tried it yet, but it looks good – much better to have a script to run once rather than editing each date one by one. May I write about your script in an update to this post?

      Also on Mr Kiss’s website it has an update from June this year saying:

      “Hofficium Hmissa download provides Nook or Kindle friendly output, convertable by freeware calibre”

      We have been using the Little Office of the Blessed Virgin Mary here lately, but good to see developments with the full office.

      veromarybrrr

      30 July, 2011 at 5:11 pm

  3. Hello,I am thinking about purchasing a kindle dx to put Mr. Kisses Divine Office program on. I have already downloaded the Hofficium file and the calibre program but have no idea how to import the officium file into the program and then convert it to be usable with a dx. I scoured the internet for some information on how to do it but came up with nothing.Any help would be appreciated.

    Scott

    20 October, 2011 at 11:34 pm

    • So, what have you got so far? Hofficium.zip needs to be unzipped. I guess you are using Windows, and I think all the recent versions of Windows can unzip files for you by double clicking on the file in Windows Explorer. Once unzipped you can find the file Officium.exe (Windows sometimes hides the “.exe” part which is very frustrating, so might be just called “Officium”) and double click on that to run it. That should bring up something like the webpage version: http://www.divinumofficium.com/cgi-bin/horas/officium.pl Is that helpful so far, or confusing?
      The idea is to use officium.exe to generate the offices, saving them on your computer – the Desktop is a handy place to be able to find the files. Then run Calibre and click the Add Books button and find the files Officium.exe made.
      Hope that helps some. I’ll have to try it out on my Windows computer to be sure.

      veromarybrrr

      21 October, 2011 at 5:15 am

      • Hello, I have the Hofficium file on my desktop.If I open the file there are two folders one of them is “horas” I am assuming that this is the file I need to import into calibre? or do I need to open it as well and just import the “latin” and “english” files. Im thinking this process might be a little beyond my knowledge of computers but there isnt any mention of how to do this anywhere on the web.Thanks!

        scott

        21 October, 2011 at 6:17 am

      • No, not the horas folder – they’re the plain text database files. In the same place as the two folders there should be some other files: cleantab.bat, Hhoras.ini and officium.exe (though again Windows hides the letters after the dot in the file names so might just be cleantab, Hhoras and officium) Double click on officium and it should pop up the program.

        veromarybrrr

        21 October, 2011 at 7:46 am

      • Oh, Ok yea, I can get the program to launch ok.I was thinking along completely different lines. there is an icon “officium perl command line interpreter” that launches the program but the interface that it launches is very different from what im used to seeing with the stand alone version. I clicked on the help file and instructions for “HTML generation getting started” displays, Im guessing this is what I want to do? I also see a button “generate offices” that looks promising as well.

        scott

        21 October, 2011 at 10:38 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Guild of Saint Tarcisius

Saint Tarcisius, Pray for Us.

Classical Liberal Arts Academy

PUERILIS INSTITUTIO EST MUNDI RENOVATIO

The Scholastic Tradition in the Modern World

Sharing the Fruits of my Contemplation

Girl Meets World

Anna Hitchings: journalist, writer, actor, musician, Liberal Arts grad. I have opinions, and lots of them. This is where Girl Meets World.

Catholic Cravings

get hungry for what lasts

La Maglia di Marica

Lavori a maglia per bambini

Catholic Homeschool Australia

a place where parents and their children can share info, ideas & general fun stuff

Jacob Degeling

Home is where your blog is

Greater Albion Typefounders

News, Discussion and Previews from the typefounders

CLAA News

The official CLAA student news source.

Living Learning

Homeschoolers sharing life and learning in the Blue Mountains

Frugal Abundance

GFCF for ASD, ADD & ADHD

Maria Lectrix

public domain audiobook podcast - for people with catholic tastes

Sticks & String

A podcast by an Australian bloke who knits.

Follow

Get every new post delivered to your Inbox.

Join 356 other followers

%d bloggers like this: