.tfw: deal gracefully with the case where no location is specified
This commit is contained in:
@@ -12,6 +12,9 @@ import lxml.html
|
||||
|
||||
def tfw(phenny, input):
|
||||
zipcode = input.group(2)
|
||||
if not zipcode:
|
||||
# default to Blacksburg, VA
|
||||
zipcode = "24060"
|
||||
|
||||
try:
|
||||
req = urlopen("http://thefuckingweather.com/?zipcode=%s" % urlquote(zipcode))
|
||||
|
||||
Reference in New Issue
Block a user