Why does this not work on gae?
def urlopen(url):
try:
from google.appengine.api.urlfetch import fetch
if url.find('?')>=0:
url,payload=url.split('?')
return fetch(url,payload=payload).content
return fetch(url).content
except:
import urllib
return urllib.urlopen(url).read()
def coords_by_address(address):
import re
try:
txt=T2.urlopen('http://maps.google.com/maps/geo?q=
%s&output=xml'%ad\
dress)
item=re.compile('\<coordinates\>(?P<la>[^,]*),(?
P<lo>[^,]*).*?\</co\
ordinates\>').search(txt)
return float(item.group('la')),float(item.group('lo'))
except: return 0.0,0.0
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---