Source: site.view [edit]
Function name: bingWebCount
Arguments: query
Description: Find number of webpages matching 'query'. If pass an optional argument, will quote string.
Page type: webl
Render function:  
Module: global

Page source:

if (Size(OPTIONALARGS) > 0) then
   query = query + `"` + query + `"`
end;

var P = GetURL("http://api.bing.net/xml.aspx",   [. appId="6B9BBC081ABFE19273DEF660066BC4A652ED47B3", Sources="Web", query=query  .]);

var E = Elem(P, "web:Total");

var count = 0;

if Size(E) > 0 then
   count = ToInt(Str_Trim(Text(E[0]))) ? 0;
end;

count;

// Pretty(P);