Fixed formatting.
This commit is contained in:
parent
146ae3c279
commit
4069dd21a3
89 changed files with 615 additions and 496 deletions
|
@ -7,7 +7,7 @@ api_url = 'http://api.wolframalpha.com/v2/query?format=plaintext'
|
|||
|
||||
@hook.command("time")
|
||||
def time_command(inp, bot=None):
|
||||
"time <area> -- Gets the time in <area>"
|
||||
"""time <area> -- Gets the time in <area>"""
|
||||
|
||||
query = "current time in %s" % inp
|
||||
|
||||
|
@ -16,8 +16,7 @@ def time_command(inp, bot=None):
|
|||
return "error: no wolfram alpha api key set"
|
||||
|
||||
request = http.get_xml(api_url, input=query, appid=api_key)
|
||||
time = " ".join(request.xpath("//pod[@title='Result']/subpod/plain" \
|
||||
"text/text()"))
|
||||
time = " ".join(request.xpath("//pod[@title='Result']/subpod/plaintext/text()"))
|
||||
time = time.replace(" | ", ", ")
|
||||
|
||||
if time:
|
||||
|
@ -25,8 +24,9 @@ def time_command(inp, bot=None):
|
|||
if inp.lower() == "unix":
|
||||
place = "Unix Epoch"
|
||||
else:
|
||||
place = capitalize_first(" ".join(request.xpath("//pod[@" \
|
||||
"title='Input interpretation']/subpod/plaintext/text()"))[16:])
|
||||
place = capitalize_first(" ".join(request.xpath("//pod[@"
|
||||
"title='Input interpretation']/subpod/plaintext/text()"))[
|
||||
16:])
|
||||
return "%s - \x02%s\x02" % (time, place)
|
||||
else:
|
||||
return "Could not get the time for '%s'." % inp
|
||||
|
@ -34,15 +34,15 @@ def time_command(inp, bot=None):
|
|||
|
||||
@hook.command(autohelp=False)
|
||||
def beats(inp):
|
||||
"beats -- Gets the current time in .beats (Swatch Internet Time). "
|
||||
"""beats -- Gets the current time in .beats (Swatch Internet Time). """
|
||||
|
||||
if inp.lower() == "wut":
|
||||
return "Instead of hours and minutes, the mean solar day is divided " \
|
||||
"up into 1000 parts called \".beats\". Each .beat lasts 1 minute and" \
|
||||
" 26.4 seconds. Times are notated as a 3-digit number out of 1000 af" \
|
||||
"ter midnight. So, @248 would indicate a time 248 .beats after midni" \
|
||||
"ght representing 248/1000 of a day, just over 5 hours and 57 minute" \
|
||||
"s. There are no timezones."
|
||||
"up into 1000 parts called \".beats\". Each .beat lasts 1 minute and" \
|
||||
" 26.4 seconds. Times are notated as a 3-digit number out of 1000 af" \
|
||||
"ter midnight. So, @248 would indicate a time 248 .beats after midni" \
|
||||
"ght representing 248/1000 of a day, just over 5 hours and 57 minute" \
|
||||
"s. There are no timezones."
|
||||
elif inp.lower() == "guide":
|
||||
return "1 day = 1000 .beats, 1 hour = 41.666 .beats, 1 min = 0.6944 .beats, 1 second = 0.01157 .beats"
|
||||
|
||||
|
|
Reference in a new issue