Beispiel #1
0
class ZillowAPI(object):
    def __init__(self):
        self.zillow = ZillowWrapper(settings.ZILLOW_API_KEY)

    def lookup(self, address, citystatezip):
        try:
            return self.ZillowPropertyResults(
                self.zillow.get_data(
                    'http://www.zillow.com/webservice/GetDeepSearchResults.htm',
                    {
                        'address': address,
                        'citystatezip': citystatezip,
                        'zws-id': self.zillow.api_key,
                        'rentzestimate': True
                    }))
        except (ZillowError, ZillowFail, ZillowNoResults), e:
            return Struct(
                dict.fromkeys(
                    self.ZillowPropertyResults.attribute_mapping.keys()))