2012-05-17, 13:21
Ok did you put that log line in? It doesn't seem to have logged anything...I can see it start the search for 3066 but it's intermingled with a general retrieval as well, so it's a bit confusing.
grrr I hate errors I can't duplicate.
So the block in quesstion is this:
...I can't see the error you mentioned though - the urllib one - it just doesn't seem to be running or erroring out at all - really odd.
So far I am stumped...it should look like this in your log:
21:15:07 T:3700 NOTICE: -->Python Interpreter Initialized<--
21:15:09 T:3700 NOTICE: CommonFunctions-0.9.2
21:15:13 T:3700 NOTICE: Oz Weather-0.3.7: Doing locations search for 3032
21:15:15 T:3700 NOTICE: Oz Weather-0.3.7: Response page url: http://weatherzone.com.au/search/
21:15:15 T:3700 NOTICE: Oz Weather-0.3.7: Multiple result ['Ascot Vale, VIC 3032', 'Highpoint City, VIC 3032', 'Maribyrnong, VIC 3032', 'Travancore, VIC 3032'] URLs ['http://www.weatherzone.com.au/vic/melbourne/ascot-vale', 'http://www.weatherzone.com.au/vic/melbourne/highpoint-city', 'http://www.weatherzone.com.au/vic/melbourne/maribyrnong', 'http://www.weatherzone.com.au/vic/melbourne/travancore']
21:15:21 T:5052 NOTICE: -->Python Interpreter Initialized<--
21:15:24 T:5052 NOTICE: CommonFunctions-0.9.2
...one thing you could try as a hack is to put the URL directly into your settings file:
So :
<setting id="Location3" value="Collingwood, VIC 3066" />
<setting id="Location3id" value="http://www.weatherzone.com.au/vic/melbourne/collingwood" />
(change the 3 to whatever number from 1 to 3....
...not ideal but might get it working...
grrr I hate errors I can't duplicate.
So the block in quesstion is this:
Code:
log("Doing locations search for " + text)
#need to submit the postcode to the weatherzone search
searchURL = 'http://weatherzone.com.au/search/'
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
host = 'www.weatherzone.com.au'
headers = { 'User-Agent' : user_agent, 'Host' : host }
values = {'q' : text, 't' : '3' }
data = urllib.urlencode(values)
req = urllib2.Request(searchURL, data, headers)
response = urllib2.urlopen(req)
resultPage = str(response.read())
#was there only one match? If so it returns the page for that match so we need to check the URL
responseurl = response.geturl()
log("Response page url: " + responseurl)
...I can't see the error you mentioned though - the urllib one - it just doesn't seem to be running or erroring out at all - really odd.
So far I am stumped...it should look like this in your log:
21:15:07 T:3700 NOTICE: -->Python Interpreter Initialized<--
21:15:09 T:3700 NOTICE: CommonFunctions-0.9.2
21:15:13 T:3700 NOTICE: Oz Weather-0.3.7: Doing locations search for 3032
21:15:15 T:3700 NOTICE: Oz Weather-0.3.7: Response page url: http://weatherzone.com.au/search/
21:15:15 T:3700 NOTICE: Oz Weather-0.3.7: Multiple result ['Ascot Vale, VIC 3032', 'Highpoint City, VIC 3032', 'Maribyrnong, VIC 3032', 'Travancore, VIC 3032'] URLs ['http://www.weatherzone.com.au/vic/melbourne/ascot-vale', 'http://www.weatherzone.com.au/vic/melbourne/highpoint-city', 'http://www.weatherzone.com.au/vic/melbourne/maribyrnong', 'http://www.weatherzone.com.au/vic/melbourne/travancore']
21:15:21 T:5052 NOTICE: -->Python Interpreter Initialized<--
21:15:24 T:5052 NOTICE: CommonFunctions-0.9.2
...one thing you could try as a hack is to put the URL directly into your settings file:
So :
<setting id="Location3" value="Collingwood, VIC 3066" />
<setting id="Location3id" value="http://www.weatherzone.com.au/vic/melbourne/collingwood" />
(change the 3 to whatever number from 1 to 3....
...not ideal but might get it working...