From 50b570f542ba2d46d9585bc82029d2ea346de93e Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Tue, 7 Dec 2010 18:36:31 -0500 Subject: [PATCH] .tfw: deal gracefully with the case where no location is specified --- modules/tfw.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/tfw.py b/modules/tfw.py index 1186686..687db7d 100755 --- a/modules/tfw.py +++ b/modules/tfw.py @@ -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))