Jump to content

GreenRaccoon23

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

#23900 BibleGateway to MySword

Posted by GreenRaccoon23 on 01 February 2015 - 06:44 PM

I figured out that the bug appears in every chapter of every book that is part of a series of books (e.g. 1 Samuel, 2 Samuel, 1 Timothy, 2 Timothy, 1 Thessalonians, 2 Thessalonians, etc.). Apparently the additional number in the title of the book is the culprit and is confusing the programming algorithm. That's my guess.

Thanks for your hard work.

Ok, sorry about the delay. It was a pretty easy fix but it helped me find a bunch of other bugs. I've finished ironing everything out and I'll upload the new version.




#23832 BibleGateway to MySword

Posted by GreenRaccoon23 on 25 January 2015 - 05:59 PM

Hi GR,
 
I've tried the new code. Still unable to download. I'm on a Mac OS X Yosemite.
 
For the Expanded Bible (EXB), I get the following error:
Traceback (most recent call last):
File "/Users/***/Downloads/bible_gateway1.py", line 569, in <module>
translation_name = Copyright(translation).search(base_url)
File "/Users/***/Downloads/bible_gateway1.py", line 156, in search
self.publisher_info = soup.p.a.text
AttributeError: 'NoneType' object has no attribute 'a'
And for other bible, such as KJV, ESV
Traceback (most recent call last):
File "/Users/***/Downloads/bible_gateway1.py", line 569, in <module>
translation_name = Copyright(translation).search(base_url)
File "/Users/***/Downloads/bible_gateway1.py", line 158, in search
self.accept_me()
File "/Users/***/Downloads/bible_gateway1.py", line 179, in accept_me
''.join((self.copyright_info_bak.strip())),
TypeError: sequence item 0: expected str instance, int found

 
Whoa, I'm not sure how I didn't catch that. Maybe I uploaded the wrong file or something. I'll fix that tonight.
 
I would compile my Go package ('bgmysword') for Mac for you, but there's a bug in the current version of Go with building programs for a different operating system. Once the next version of Go comes out, I'll be able to upload a Mac package.  :)
 
 
EDIT
Fixed! :)

Also, I just had an idea. You could try this: Attached File  bgmysword.zip   2.86MB   14 downloads It's for Linux but it MIGHT work for Mac. 




#23831 BibleGateway to MySword

Posted by GreenRaccoon23 on 25 January 2015 - 05:43 PM

I figured out that the bug appears in every chapter of every book that is part of a series of books (e.g. 1 Samuel, 2 Samuel, 1 Timothy, 2 Timothy, 1 Thessalonians, 2 Thessalonians, etc.). Apparently the additional number in the title of the book is the culprit and is confusing the programming algorithm. That's my guess.

Thanks for your hard work.

Ok thanks I'll look into it tonight. I'm sure it's just a little, dumb mistake I made.




#23734 BibleGateway to MySword

Posted by GreenRaccoon23 on 17 January 2015 - 03:03 AM

I've translated this program into a different coding language because I wanted to make it a little easier to install it. It's like 10 times faster now too. I'm still working out a couple kinks to make it a stand-alone program, so I can't upload it yet. But in case anyone knows how to set up Golang packages, I'll post the link to the "source code" on my github account.

 

https://github.com/G...oon23/bgmysword




#23534 BibleGateway to MySword

Posted by GreenRaccoon23 on 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?




#23520 BibleGateway to MySword

Posted by GreenRaccoon23 on 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.




#23517 BibleGateway to MySword

Posted by GreenRaccoon23 on 03 January 2015 - 12:42 AM

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




#23516 BibleGateway to MySword

Posted by GreenRaccoon23 on 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. :)




#21770 ESV on MySword

Posted by GreenRaccoon23 on 05 August 2014 - 11:33 AM

Nice!!! Thanks a ton Rob! I'll post some quick instructions for any other Linux users.

 

1- Download the script at the bottom of the top post.

2- Install dependencies.

sudo aptitude install libclass-dbi-sqlite-perl

3- Extract/unzip it.

cd ~/Downloads
unzip esvorg2mysword.pl.zip

4- Make the script executable.

cd esvorg2mysword.pl
chmod +x *.pl

5- Run the script. (If this doesn't work, check the bottom of this post.)

./*.pl

6- After a few seconds, it'll ask for you to accept the terms. Read it, and if you accept, type

accept

7- It is alive. It'll take a while to run the script. You can see its progress. When it's done, it'll tell you to hit enter.

8- You'll have a new file called "ESV.bbl.mybible" inside the directory "~/Downloads/esvorg2mysword.pl".

9- Copy "ESV.bbl.mybiblefrom your computer to your phone or tablet that has the MySword app. Paste "ESV.bbl.mybible" in the "mysword/bibles" folder.

10- Done! Open up MySword and it should automatically detect it. If the title isn't "ESV," go to "Menu", then "Preferences", and hit "Clear abbreviations cache."

 

----------

 

5b- If the script wouldn't run, you might need to install some more dependencies. It might tell you "Can't locate *...". Open up Ubuntu Software Center and search for whatever it couldn't locate. For example, mine said "Can't locate DBI.pm", so I searched for "dbi" in Ubuntu Software Center. Then I installed "libclass-dbi-sqlite-perl", and that fixed it for me.