Jump to content

GreenRaccoon23

Member Since 05 Aug 2014
Offline Last Active Feb 24 2015 01:19 PM
*****

Topics I've Started

BibleGateway to MySword

03 January 2015 - 12:41 AM

I wrote a script to fetch bibles off of biblegateway.com and turn them into MySword modules. :ph34r: It even creates MySword tags for titles, paragraphs, footnotes, indents, and words of Jesus (if the translation on BibleGateway includes them). I haven't tested this script on Windows yet, but it should work. Finally got to test it, and it's working for me, at least.
 
Atheist Rob wrote an awesome perl script like this, but I wanted to see if I could do it with python and Go.

Please don't abuse this script; if the Bible translation is copyrighted, don't download it.
 
 *Update 2-1-15*
I made a few fixes in the stand-alone program. If you're running 64-bit Windows (or 64-bit Linux), use this one (it's way easier and faster). You can check if you're running 64-bit Windows by clicking the Start/Windows menu, right-clicking Computer, selecting Properties, and scrolling down to the line that says "System Type:". It will say either 64-bit or 32-bit. If you have 32-bit, you'll have to do the long method under update 1-25-15, sorry.  :(

 

To run it:

  • Download the file below.
  • Unzip it. (Right-click 'bgmysword', select 'Extract All..', then click 'Extract'.)
  • Double-click it.
  • Type in the abbreviation of the translation you want (e.g., KJV). (The abbreviations are listed on biblegateway.com/versions).

It'll run at least 10 times faster than the other script I uploaded (because it's written in Google's programming language Go and Google doesn't know what 'slow' means).  :ph34r:

Windows: Attached File  bgmysword.zip   2.33MB   240 downloads

Linux:       Attached File  bgmysword.zip   2.9MB   49 downloads

---------------------------------------------------------------------------------------------

   Old version (don't use this):  Attached File  bgmysword.zip   2.33MB   26 downloads

 
 

 *Update 1-25-15
Couple fixes. If you're using 64 bit Windows or Linux, use the file ^above. Otherwise, use these.

For Windows:            Attached File  bible_gateway_win.py.zip   6.16K   60 downloads

For Linux and Mac:   Attached File  bible_gateway.py.zip   6.57K   39 downloads

---------------------------------------------------------------------------------------------

   Old versions (don't use these):

   version 1 - Attached File  bible_gateway.py.zip   6.61K   24 downloads

   version 2 - Attached File  bible_gateway_win.zip   6.28K   13 downloads (Windows)
                     Attached File  bible_gateway.zip   6.77K   8 downloads (Linux and Mac)

 
You'll need to have python 3 installed on your computer (python 3.4.2). You'll also need to install some python modules. I'll show you how to do this.

Install Dependencies:
For Windows,

  • Download python 3.4.2 here: https://www.python.o...nloads/windows/
    • Scroll down to where it says Python 3.4.2
    • Choose Windows x86-64 MSI Installer if you have 64-bit Windows, or choose Windows x86 MSI Installer if you have 32-bit Windows.
      • If you're not sure whether you have 64-bit or 32-bit, press the Windows/Start button, right-click Computer, and select Properties. Under "System-Type", it will say either 64-bit Operating System or 32-bit Operating System.
    • When running the installer, if you're not sure what to do, just choose all of the default options except for this one:
      • When you are at the screen which says Customize Python 3.4.2, scroll down to where it says Add python.exe to Path, select the red X, and choose Entire feature will be installed on local hard drive.
  • Download "lxml" with these steps:
    • Download this file: Attached File  install-python-dependencies.zip   547bytes   63 downloads
    • Right-click it and select "Extract-all..."
    • Double-click the new file "install-python-dependencies".

For Linux,

  • Open Terminal (ctrl+alt+t).
  • Install python 3:
    For Ubuntu:
    sudo apt-get install python3
    For Arch Linux:
    sudo pacman -S python
  • Install pip:
    For Ubuntu:
    sudo apt-get install python-pip
    For Arch Linux:
    sudo pacman -S python-pip
  • Use pip to install these modules:
    sudo pip install BeautifulSoup
    sudo pip install lxml
    sudo pip install requests

Run It:
For Windows:

  • Unzip the file.
  • Open up cmd.exe
  • Switch to your Downloads folder with this command:
    cd %HOMEPATH%\Downloads
  • Run this command:
    python bible_gateway_win.py KJV
    Replace 'KJV' with the abbreviation of the translation you want. The abbreviations are listed on biblegateway.com.

For Linux:

  • Unzip the file.
  • Open up Terminal (ctrl+alt+t)
  • Change directory to 'Downloads' with this command:
    cd ~/Downloads
  • Run these commands:
    chmod +x *.py
    python bible_gateway.py KJV
    Replace 'KJV' with the abbreviation of the translation you want. The abbreviations are listed on biblegateway.com.

Once you download the Bible module, it'll be named '***.bbl.mybible'. Just place it in the mysword folder of your Android phone or tablet (or phablet, if you've got a massive Samsung phone like me :P ).

Feel free to modify or distribute this script. Just please do not distribute any modules that this script creates, and please do not download copyrighted Bibles.

If anyone has any problems or questions, let me know. :)