Source: site.view [edit]
Function name: zillowEstimate
Arguments: address
Description: Uses Zillow to get a property estimate
Page type: webl
Render function:  
Module: maybeathome

Page source:

address = Wub_ReplaceAll(address, "-", " ");


var loc = WubCall("global.geocode", [address]);

var P = GetURL("http://www.zillow.com/webservice/GetSearchResults.htm",
             [. "zws-id" = "X1-ZWz1fdsisk8ykr_7hp6b", "address" = loc.streetNumber + " " + loc.street,
                "citystatezip" = loc.city + " " + loc.state + " " + loc.postalCode
              .]) ? nil;

var addr2;

var price = "0";
var s = "0";

if (P != nil) then
   var E = Elem(P, "amount");
   if Size(E) > 0 then
      s = Str_Trim(Text(E[0]));
      var i = 1;
      price = "";
      while i < Size(s) + 1 do
         if (i mod 3 == 1 and price != "") then
            price = "," + price;
         end;
         price = Select(s, Size(s) - i, Size(s)-i+1) + price; 
         i = i + 1
      end;
      var currency = E[0].currency ? nil;
      if currency == "USD" then
         price = "$" + price;
      end      
   else
      price = "0"
   end
end;


NewPage(price, "text/plain");