Source: site.view [edit]
Function name: forecast5day
Arguments: zip
Description: Display five-day weather forecast (weatherunderground)
Page type: webl
Render function:   rowRender
Module: global

Page source:

var P = GetURL("http://www.wunderground.com/cgi-bin/findweather/getForecast",
   [. query=zip, brand="mobile" .] );
// (brand is important)

if (P != nil) then
  var title = Text(Elem(P, "h2")[0]);

  // Five-day forecast is table with align="center"
  var table = Select(Elem(P, "table"), fun(e) (e.align == "center") ? false end)[0];

  Delete(Elem(table, "br"));
  Delete(Pat(table, "/>"));  // broken HTML cleanup

  var tds = Elem(table, "td");

  var ans = [];
  every td in tds do
    ans = ans + [Content(td)];
  end;

  [[title], ans]

else
   nil
end;