Scrape norwegian Bibles on Youversion website and generate a Logos compatible format
Project description
I'm trying to make the code:
-
Scrape the Bible text off bible.com for any defined Bible translation. The URL for the Bible text is: https://www.bible.com/no/bible/"+TRANSLATION_NUMBER+"/"+BOOK+"."+CHAPTER+".nb" The translation number defines which translation is used. E.g. the Norwegian 1988 translation is version number 102. The Bible book is a three-letter abbreviation for the book. The abbreviations used on the site are defined in the array "booklist" (not to be confused with bbooklist, which are the abbreviations used on Logos)
-
Separate out just the text - remove all HTML tags, and add Logos program tags. The information on Logos formatting is found on https://wiki.logos.com/Personal_Books What is needed here is basically the "field on/off:bible" and Bible verse link. For instance, in John 1:1, you might get:
{{field-off:bible}} KAPITTEL 1 [[@BibleNO2011:jn 1:1]] 1 {{field-on:bible}}I begynnelsen var Ordet, og Ordet var hos Gud, og Ordet var Gud. {{field-off:bible}}
For the Bible verse link in Logos, the syntax is: [[@Bible "TRANSLATION" : "BOOK" "CHAPTER":"VERSE"]] The Bible book abbreviations in Logos are different than the ones used on bible.com, and are found in the list "bbooklist".
I'm attaching my awesome code.
Thanks - this will make studying the Bible much easier both for me, and for many other pastors and Bible students in Norway.
Versions specific problems
102
Stars, stars everywhere 1 chr 29 : 22, 1 chr 22 : 9, 1 chr 21 : 1
2216
Not split on the digits, be a bit smarter, all the numbers in Ezekiel disappear https://www.bible.com/bible/2216/EZK.29.BGO
29
The quotes are in a different container div.class=qt e.g. https://www.bible.com/bible/29/ACT.8.N11BM John 8 The passage about the adulterous woman, basically fix the numbering https://www.bible.com/bible/29/JHN.8.N11BM
115
Numbering issues https://www.bible.com/bible/115/REV.21.ELB verse 18, quotation issues 1 peter 2 : 6 https://www.bible.com/bible/115/1PE.2.ELB
30
Numbering issues, John 8, Micha 1 : 2+ quotations...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.