Collaborama About Help Contact Anonymous [login] Source: site.view [edit] Function name: blogs Arguments: Description: Displays an aggregated list of all blogs marked with a 'blog' flag. Page type: webl Render function: blogRender Module: site Page source: var logcmds = Wub_GetFunctionsByTag("flag.blog"); var aggregate = []; var addBlogName = fun(blogname, entries) var res = []; every e in entries do e.title := blogname + ": " + (e.title ? "No Title"); res = res + [e] end; res end; // aggregate every logcmd in logcmds do var log = (WubCall(logcmd, []) ? [. entries=[] .]); var entries = (log.entries ? []); aggregate = aggregate + addBlogName(logcmd, entries) end; // sort var df = Wub_GetDateFormatClass(); var dfmed = df.getDateTimeInstance(df.SHORT, df.MEDIUM); var dfshort = df.getDateTimeInstance(df.SHORT, df.SHORT); var EntryTimeAsLong= fun(entry) return (dfmed.parse(entry.when).getTime() ? dfshort.parse(entry.when).getTime() ? 0) end; aggregate = Wub_FunctionSort(EntryTimeAsLong, aggregate, -1); [. title="All WubHub Blogs", entries=aggregate .];