Libraryless. Click here for Pure Java version (4888L/32K/111K).
!7 static S html() { new StringBuilder buf; buf.append("<html>"); buf.append("<head><title>BotCompany Internal Bots</title></head>"); buf.append("<body>"); buf.append("<h3><a href=" + htmlQuote("http://BotCompany.de") + ">BotCompany.de</a> Bots</h3>"); buf.append("<ul>"); O mainBot = getMainBot(); L<S> botsToList = litlist(getProgramID(mainBot)); O dispatcher = getDispatcher(); if (dispatcher != null) botsToList.addAll((L) call(dispatcher, "getSubBotIDs")); L activeBots = cast get(mainBot, "activeBots"); botsToList.addAll(activeBots); for (S botID : botsToList) { botID = formatSnippetID(botID); S parsedID = "" + parseSnippetID(botID); S title = "?"; pcall { title = getSnippetTitle_cached(botID); } // TODO: free cache occasionally S name = botID + " - " + htmlencode(title); buf.append("<li><a href=" + htmlQuote("/" + parsedID) + ">" + name + "</a> ("); buf.append("<a href=" + htmlQuote("http://code.botcompany.de/" + parsedID) + ">source</a>)</li>"); } buf.append("</ul>"); buf.append("<p>Hit count: " + getOpt(mainBot, "hitCount") + "</p>"); buf.append("<p>Last interactions:</p>"); pcall { int maxInteractionsToPrint = 10; L<Map> history = cast get(mainBot, "history"); for (int i = l(history)-1; i >= 0 && i >= l(history)-maxInteractionsToPrint; i--) { Map m = history.get(i); buf.append("<p>" + htmlencode(m.get("question")) + "<br> " + htmlencode(m.get("answer")) + "</p>"); } } buf.append("</body>"); buf.append("</html>"); ret str(buf); }
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment