2009-04-01 23:09:06 +00:00
|
|
|
import urllib
|
|
|
|
|
2009-07-08 17:04:30 +00:00
|
|
|
from util import hook
|
2009-04-01 23:09:06 +00:00
|
|
|
|
2009-04-18 00:57:18 +00:00
|
|
|
|
2009-04-01 23:09:06 +00:00
|
|
|
@hook.command('god')
|
|
|
|
@hook.command
|
|
|
|
def bible(inp):
|
|
|
|
base_url = 'http://www.esvapi.org/v2/rest/passageQuery?key=IP&' \
|
|
|
|
'output-format=plain-text&include-heading-horizontal-lines&' \
|
|
|
|
'include-headings=false&include-passage-horizontal-lines=false&' \
|
|
|
|
'include-passage-references=false&include-short-copyright=false&' \
|
|
|
|
'include-footnotes=false&line-length=0&passage='
|
|
|
|
|
|
|
|
text = urllib.urlopen(base_url + urllib.quote(inp)).read()
|
|
|
|
|
|
|
|
text = ' '.join(text.split())
|
2009-04-18 00:57:18 +00:00
|
|
|
|
2009-04-01 23:09:06 +00:00
|
|
|
if len(text) > 400:
|
|
|
|
text = text[:text.rfind(' ', 0, 400)] + '...'
|
|
|
|
|
|
|
|
return text
|