A simple bible content provider
A RoR application that provides content from the bible. The content collected was the Nova Versão Internacional bible in brazilian portuguese. It was scrapped from http://www.bible.com/.
Assuming that you have Ruby, Rails and MySQL properly installed and configured in your machine:
Clone this repository to your machine:
git clone https://github.com/thiagokimo/bible_service.git
Inside the project directory:
bundle install
Create and migrate the databases:
rake db:create
rake db:migrate
In order to populate the database, run the following task:
rake bible:get_bible
There are 3 main entities:
The application has a crawler that populates the database parsing each html page, scrapping the content related to each
entitie. All scrap processes were built as rake tasks and can be triggered anytime. More information in lib/tasks/bible.com.rake
The service exports the information as json by HTTP requests. All routes are nested as Book, Chapter and Verse respectively. The regular expressions to retrieve each entitie information corresponds to its own rake route:
To get the information, access the URL's according to its entitie. Inside the project's folder, start the server with
rails s
and try the following examples:
Whole bible: - http://localhost:3000/books.json
All chapters from the book Exodus - http://localhost:3000/books/2/chapters.json
All verses from the first chapter of Genesis: - http://localhost:3000/books/1/chapters/1/verses.json
Please ensure that you provide appropriate test coverage and ensure the documentation is up-to-date. It is encouraged that you perform changes in a clean topic branch rather than a master and that you create a pull request for them. This will facilitate discussion and revision.
Please be clean, keep your commits atomic and with the smallest possible logical change. This will increase the likelihood of your submission to be used.
If you discover any bugs, feel free to create an issue on GitHub. Please add as much information as possible to help us fixing the possible bug.
https://github.com/thiagokimo/bible_service/issues
Copyright (c) 2012 Thiago Moreira Rocha.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy and modify copies of the Software, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.