Jump to content

Please read the Forum Rules before posting.

Photo

BibleGateway to MySword


  • Please log in to reply
50 replies to this topic

#1 GreenRaccoon23

GreenRaccoon23

    Liking e-Sword

  • Members
  • PipPip
  • 19 posts
  • LocationIowa/Nebraska, United States
Offline

Posted 03 January 2015 - 12:41 AM

*
POPULAR

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. :)


Edited by GreenRaccoon23, 02 February 2015 - 09:41 AM.

Lutheran sin|nerNinja in the Lutheran Ninja Clan.  :ph34r: http://www.worldview...ran-ninja-clan/

 

"You know less than does a log on the ground."

"Your words are so foolishly and ignorantly composed that I cannot believe you understand them."

-Martin Luther (who else?)


#2 GreenRaccoon23

GreenRaccoon23

    Liking e-Sword

  • Members
  • PipPip
  • 19 posts
  • LocationIowa/Nebraska, United States
Offline

Posted 03 January 2015 - 12:42 AM

(I used to have the code here, but I decided to delete it because it was so long.)


Edited by GreenRaccoon23, 19 January 2015 - 07:04 PM.

Lutheran sin|nerNinja in the Lutheran Ninja Clan.  :ph34r: http://www.worldview...ran-ninja-clan/

 

"You know less than does a log on the ground."

"Your words are so foolishly and ignorantly composed that I cannot believe you understand them."

-Martin Luther (who else?)


#3 APsit190

APsit190

    e-Sword Tools Developer

  • Members (T)
  • PipPipPipPipPip
  • 1,566 posts
  • LocationThe Land of the Long White Cloud
Offline

Posted 03 January 2015 - 01:38 AM



 

Open cmd.exe.

 

 

Simply known as the Command Prompt and before XP, was known as MS DOS and PC DOS.

 

How the memories keep on flooding back. :wub:

 

Blessings,

Autograph.png


#4 GreenRaccoon23

GreenRaccoon23

    Liking e-Sword

  • Members
  • PipPip
  • 19 posts
  • LocationIowa/Nebraska, United States
Offline

Posted 03 January 2015 - 01:44 AM

Simply known as the Command Prompt and before XP, was known as MS DOS and PC DOS.

 

How the memories keep on flooding back. :wub:

 

Blessings,

Haha nice. When I was a kid, we even had a Commodore 64 that was basically only a command screen.


Lutheran sin|nerNinja in the Lutheran Ninja Clan.  :ph34r: http://www.worldview...ran-ninja-clan/

 

"You know less than does a log on the ground."

"Your words are so foolishly and ignorantly composed that I cannot believe you understand them."

-Martin Luther (who else?)


#5 peterpanpirate

peterpanpirate

    Liking e-Sword

  • Members
  • PipPip
  • 28 posts
Offline

Posted 03 January 2015 - 07:02 AM

How difficult would it be to get this working with bible.com?

#6 GreenRaccoon23

GreenRaccoon23

    Liking e-Sword

  • Members
  • PipPip
  • 19 posts
  • LocationIowa/Nebraska, United States
Offline

Posted 03 January 2015 - 05:18 PM

How difficult would it be to get this working with bible.com?

Hmmm, probably not very hard. bible.com doesn't seem to have as many options as BibleGateway though. Does it have versions that biblegateway.com doesn't?


Lutheran sin|nerNinja in the Lutheran Ninja Clan.  :ph34r: http://www.worldview...ran-ninja-clan/

 

"You know less than does a log on the ground."

"Your words are so foolishly and ignorantly composed that I cannot believe you understand them."

-Martin Luther (who else?)


#7 peterpanpirate

peterpanpirate

    Liking e-Sword

  • Members
  • PipPip
  • 28 posts
Offline

Posted 03 January 2015 - 10:08 PM

Hmmm, probably not very hard. bible.com doesn't seem to have as many options as BibleGateway though. Does it have versions that biblegateway.com doesn't?

It does have a tad few more



#8 GreenRaccoon23

GreenRaccoon23

    Liking e-Sword

  • Members
  • PipPip
  • 19 posts
  • LocationIowa/Nebraska, United States
Offline

Posted 03 January 2015 - 11:11 PM

It does have a tad few more

I'll look into it.  :) I've got to do a funeral this week, so I probably won't be able to start until next week.


Lutheran sin|nerNinja in the Lutheran Ninja Clan.  :ph34r: http://www.worldview...ran-ninja-clan/

 

"You know less than does a log on the ground."

"Your words are so foolishly and ignorantly composed that I cannot believe you understand them."

-Martin Luther (who else?)


#9 APsit190

APsit190

    e-Sword Tools Developer

  • Members (T)
  • PipPipPipPipPip
  • 1,566 posts
  • LocationThe Land of the Long White Cloud
Offline

Posted 04 January 2015 - 01:53 PM



Hmmm, probably not very hard. bible.com doesn't seem to have as many options as BibleGateway though. Does it have versions that biblegateway.com doesn't?

 

Bible.com develops a Bible study program for both Android and iPhone/Pad, and its resources are developed for their particular software. In other words, these are not webpage (html) based files, as where BibleGateway is. So, with that, I think that you may encounter some difficulties.

 

Blessings,

Autograph.png


#10 Don Martin

Don Martin

    New to Bible Support

  • Members
  • Pip
  • 5 posts
Offline

Posted 14 January 2015 - 06:54 AM

Noob here to C++/python ... have played with php some and Fortran 77 back in the day LOL ... I'm stuck installing lxml.

I've installed Visual Studio C++ Express 2010, Python 3.4.2, BeautifulSoup and pip.  I can't get lxml to install ... looks like I'm missing libxml2 and libxslt.  I found pre-compiled libraries (libxml2-2.7.8.win32 & libxslt-1.1.26.win32) from http://xmlsoft.org/sources/win32/ and unpacked them, then put the paths to the bin folder into my Path, but still no luck.  I saw some windows installers for lxml but only for python 3.2

Windows 7 32 bit
Python 3.4.2

Modules installed:
beautifulsoup 4.3.2
pip 1.5.6
requests 2.5.1
setuptools 2.1
virtualenv 12.0.5

Here is a link to my error log: damartin.net\files\pip.log

Any suggestions?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users