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