- import urllib2, re
- def get_passage(passage):
- key = "06f2c9d3f664a01e"
- passage = "+".join(passage.split())
- options = ['include-short-copyright=0',
- 'include-audio-link=0',
- 'include-passage-horizontal-lines=0',
- 'include-heading-horizontal-lines=0']
- options = "&".join(options)
- url = "http://www.esvapi.org/v2/rest/passageQuery?key=%s&%s&passage=%s" % (key,options,passage)
- f = urllib2.urlopen(url)
- data = f.read()
- return data
- print get_passage("Genesis 1:50")
- simple_passage = re.compile("""
- (?P<book> [0-9]?[a-z]*\ ? [a-z]+)\
- (?P<chapter> [0-9]+):
- (?P<start_verse> [0-9]*)\-?
- (?P<end_verse> [0-9]*)
- """, re.IGNORECASE | re.VERBOSE)
- complex_passage = re.compile("""
- (?P<book> [0-9]?[a-z]*\ ? [a-z]+)\
- (?P<chapter> [0-9]+):
- (?P<start_verse> [0-9]*)\-
- (?P<second_chapter> [0-9]+):
- (?P<end_verse> [0-9]+)
- """, re.IGNORECASE | re.VERBOSE)
- def replace_semicolon(passage):
- passage = passage.split(";")
- book = re.match(r"[0-9]?[A-Za-z]* ?[A-Za-z]+", passage[0]).group()
- passage[1] = book + passage[1]
- return passage
- books = ["Genesis","Exodus","Leviticus","Numbers","Deuteronomy","Joshua","Judges","Ruth","1 Samuel","2 Samuel","1 Kings","2 Kings","1 Chronicles","2 Chronicles","Ezra","Nehemiah","Esther","Job","Psalm","Proverbs","Ecclesiastes","Song of Solomon","Isaiah","Jeremiah","Lamentations","Ezekiel","Daniel","Hosea","Joel","Amos","Obadiah","Jonah","Micah","Nahum","Habakkuk","Zephaniah","Haggai","Zechariah","Malachi","Matthew","Mark","Luke","John","Acts","Romans","1 Corinthians","2 Corinthians","Galatians","Ephesians","Philippians","Colossians","1 Thessalonians","2 Thessalonians","1 Timothy","2 Timothy","Titus","Philemon","Hebrews","James","1 Peter","2 Peter","1 John","2 John","3 John","Jude","Revelation" ]
bible
Posted by Anonymous on Fri 6th May 2011 20:56
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
stupidbob307.kpaste.net RSS