Merge pull request #98 from jstultz/weather
Show weather for other users
This commit is contained in:
commit
65846913e4
|
@ -6,7 +6,7 @@ from util import hook, http
|
||||||
@hook.api_key('wunderground')
|
@hook.api_key('wunderground')
|
||||||
@hook.command(autohelp=False)
|
@hook.command(autohelp=False)
|
||||||
def weather(inp, chan='', nick='', reply=None, db=None, api_key=None):
|
def weather(inp, chan='', nick='', reply=None, db=None, api_key=None):
|
||||||
".weather <location> [dontsave] -- gets weather data from Wunderground "\
|
".weather <location> [dontsave] | @<nick> -- gets weather data from Wunderground "\
|
||||||
"http://wunderground.com/weather/api"
|
"http://wunderground.com/weather/api"
|
||||||
|
|
||||||
if not api_key:
|
if not api_key:
|
||||||
|
@ -17,6 +17,11 @@ def weather(inp, chan='', nick='', reply=None, db=None, api_key=None):
|
||||||
db.execute(
|
db.execute(
|
||||||
"create table if not exists location(chan, nick, loc, lat, lon, primary key(chan, nick))")
|
"create table if not exists location(chan, nick, loc, lat, lon, primary key(chan, nick))")
|
||||||
|
|
||||||
|
if inp[0:1] == '@':
|
||||||
|
nick = inp[1:].strip()
|
||||||
|
loc = None
|
||||||
|
dontsave = True
|
||||||
|
else:
|
||||||
loc = inp
|
loc = inp
|
||||||
|
|
||||||
dontsave = loc.endswith(" dontsave")
|
dontsave = loc.endswith(" dontsave")
|
||||||
|
|
Loading…
Reference in New Issue