Project

esv_api

0.0
No commit activity in last 3 years
No release in over 3 years
ESV API Wrapper.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0

Runtime

 Project Readme

ESV_API

An API Wrapper for the ESV API

Installation

    gem 'esv_api'

Usage

For your rails app:

    #Create an initializer:
	
	ESV.configure do |config|
	  config.api_key = YOUR_API_KEY
	end
    @esv_text = ESV.passage_query( params[:passage] || "John 1", { 'include-footnotes' => 'false', 'include-headings' => 'false', 'include-subheadings' => 'false', 'include-audio-link' => 'false' } )

Query Types

The following methods are available as query types:

    passage_query(passage, options={})
	
    query( q, options={} )
    
    reading_plan_query( options={} )
    
    query_info( q, options={} )
    
    reading_plan_info( options={} )
    
    verse( options={} )
    
    daily_verse( options={} )

Query Options

The gem mirrors the API. To pass in options, just use the options hash in any available method, using options of the same name as specified in the ESV API documentation.

For example:

    @esv_text = ESV.passage_query( params[:passage] || "John 1", { 'include-footnotes' => 'false', 'include-headings' => 'false', 'include-subheadings' => 'false', 'include-audio-link' => 'false' } )

Formatting HTML Output

HTML is the default output and will appear unless output-format is specified. To make full use of the text, you will probably want to link a CSS stylesheet to your page, either one you've created or GNP's CSS. This stylesheet contains close to the minimum markup needed to render the text accurately.

Caching

If you have the dalli gem installed, esv_api will cache the data returned from passage_query calls, taking options into account when setting the key.

Credits

With love to the Twitter Gem, from which I borrowed heavily.