Пример #1
0
 def geocode(self, string, exactly_one=True):
     params = {'q': self.format_string % string}
     url = self.url % urlencode(params)
     
     logger.debug("Fetching %s..." % url)
     page = urlopen(url)
     
     return self.parse_json(page, exactly_one)
Пример #2
0
    def geocode_url(self, url, exactly_one=True):
        logger.debug("Fetching %s..." % url)
        page = urlopen(url)

        return self.parse_json(page, exactly_one)