[sword-devel] Scripturizer

Don A. Elbourne Jr. sword-devel@crosswire.org
Fri, 5 Dec 2003 22:55:44 -0600


Dean Peters has a great little perl script that can slurp through a text
file and insert html links. He created it as a Movable Type plug-in to link
scripture references to the Bible Gateway. But you can feed it any file and
with one simple change the links can point to The bible Tool. You can get
the code here:

http://www.healyourchurchwebsite.com/archives/000768.shtml

 Its the module: Scripturizer.pm

Just replace the $link variable

  my $link =
"http://biblegateway.com/cgi-bin/bible?language=english&version=$bible&passa
ge=";

with

  my $link = "http://thebibletool.com/passagestudy.jsp?key=";


Then you can run your text through it with a script something like this:

BEGIN { push(@INC, "C:/perl/lib/"); }
use Sermonizer::Scripturizer;

my $filename = "howtopray.htm";
open(FILE, $filename ) or die "Couldn't open the file '$filename'. \n$!";

foreach (scripturizeArray(<FILE>)) {
 print  $_;
}
close FILE;

It looks like it works pretty good. I just did "How to Pray" by R. A. Torry:
It doesn't catch abbreviations, but that should not be difficult to add.

Check out the results:
http://lakeshorebaptist.net/library/howtopray.html

About a year ago I obtained the plain text file of this book and I used it
as my morning devotion each day for a couple of weeks. I'd read one chapter
and convert it to XHTML. the text file had the italicized words as all caps
so I changed them to <em> and corrected a few OCR errors. I can't tell you
how satisfying it was to just now insert all the scripture links in about 1
second. :) I still need to break the chapters into individual pages and link
the chapters to the TOC.

BTW, I highly recommend this book. Its a short little book and its about 100
years old, yet I think its one of the best treatments on the subject of
prayer I've ever read.

Enjoy the book, enjoy the script, and give God the glory.



by grace alone,

Don A. Elbourne Jr.
http://elbourne.org