Source: site.view [edit]
Function name: getSFStationPartyInfo
Arguments: url
Description: Returns an information record given a URL to sfstation.com
Page type: webl
Render function:  
Module: global

Page source:

// Load page
var P = GetURL(url);

// label
var label = "Event";
every S in Elem(P, "span") do
   var c = (S.class ? "");
   if (c == "title16b") then
      label = Text(S)
   end
end;

// description
var Elems = Elem(P, "table") directlyafter (Elem(P, "table") contain Pat(P, "DESCRIPTION"));
var description = Str_Trim(WubCall("cleanUpString", [Text(Elems[0])]));

// address
Elems = Elem(P, "td") after (Elem(P, "table") contain Pat(P,  "LOCATION/TIME")) ;
var Chil = Children(Elems[1]);
var TidySecondChild = Str_Replace(Text(Chil[2]), '\n', ' ');
TidySecondChild = Str_Replace(TidySecondChild , '\"', ' ');
TidySecondChild = Str_Replace(TidySecondChild , '/', ' ');
TidySecondChild = Str_Replace(TidySecondChild , '>', ' ');
var addr = WubCall("cleanUpString", [Text(Chil[0]) + Text(Chil[2])]);

// lat/long -- lookup now, so map doesn't have to do it
var loc = WubCall("geocode", [addr]);
var lat = (loc.lat ? "unknown");
var long = (loc.long ? "unknown");
var res = [. label = label, addr = addr, desc = description .];
if (lat != "unknown") and (long != "unknown") then
   res["lat"] := lat;
   res["long"] := long
end;

res;