Fixed some bugs in the weather command.

This commit is contained in:
Jeremy Fincher 2003-03-13 07:31:38 +00:00
parent 677a63a1c7
commit 5ec9df1a2d

View File

@ -182,9 +182,9 @@ class Http(callbacks.Privmsg):
url = "http://www.weather.com/weather/local/%s?lswe=%s" % (zip, zip) url = "http://www.weather.com/weather/local/%s?lswe=%s" % (zip, zip)
try: try:
html = urllib2.urlopen(url).read() html = urllib2.urlopen(url).read()
city, state = _cityregex.search(html).groups() city, state = self._cityregex.search(html).groups()
temp = _tempregex.search(html).group(1) temp = self._tempregex.search(html).group(1)
conds = _condregex.search(html).group(1) conds = self._condregex.search(html).group(1)
irc.reply(msg, 'The current temperature in %s, %s is %dF with %s\ irc.reply(msg, 'The current temperature in %s, %s is %dF with %s\
conditions' % (city, state, int(temp), conds)) conditions' % (city, state, int(temp), conds))
except AttributeError: except AttributeError: