Libraryless. Click here for Pure Java version (643L/6K/17K).
!752 static O mainBot; static S talkPageID = "#1002123"; static int maxQuestionLength = 500; static int maxAnswerLength = 200; static S html(S subUri, Map<S, S> params) { S id = params.get("id"); S slogan = params.get("slogan"); S sloganStyle = params.get("sloganStyle"); S bottomLink = params.get("bottomLink"); S imgLink = "http://tinybrain.de/"; if (id == null) ret "please specify id"; S imgURL = snippetImageURL(id); new StringBuilder buf; buf.append("<html><head><title>" + slogan + "</title></head>\n" + "<table width='100%' height='100%' border=0><tr><td align=center>"); buf.append("<a href=" + htmlQuote(imgLink) + "><img src=" + htmlQuote(imgURL) + " border=0></a>"); if (!empty(slogan)) { buf.append("<br><br><br>"); buf.append("<span style=" + htmlQuote(sloganStyle) + ">" + slogan + "</span>"); int i = l((L) get(mainBot, "bots")); int n = l((L) get(mainBot, "botIDs")); buf.append("<br><br><b>" + "<a href=" + htmlQuote("http://tinybrain.de:8080/getraw.php?id=" + parseSnippetID(talkPageID) + "&contentType=text/html") + ">" + i + "/" + n + " bots ready to talk. TALK TO ELEUTHERIA HERE.</a></b>"); L history = cast get(mainBot, "history"); if (!empty(history)) pcall { buf.append("<br><br><br><b>Last dialogs:</b><br><br>"); int x = max(l(history)-5, 0); for (i = x; i < l(history); i++) { O dialog = history.get(i); S q = shorten(getString(dialog, "question"), maxQuestionLength); S a = shorten(getString(dialog, "answer"), maxAnswerLength); buf.append("User: <b>" + htmlencode(q) + "</b><br>\n"); buf.append("Eleutheria: <b>" + htmlencode(a) + "</b><br>\n"); } } buf.append("<br><br>"); //buf.append("<a href=" + htmlQuote("https://www.reddit.com/r/learnprogramming/comments/3vnf1w/programmer_friends/") + ">Join our community!</a>"); buf.append([[<center><form action="http://bots.tinybrain.de/1002018/submit"><input type="text" name="email" value="my@email.com"> <input type="submit" value="Join our community!"> </form></center>]]); buf.append("<br><br>"); buf.append("<a target=_blank href=" + htmlQuote("http://bots.tinybrain.de") + ">Bot list.</a>"); } if (!empty(bottomLink)) buf.append("</td></tr> <tr height=1><td align=center>" + bottomLink); buf.append("</td></tr></table>\n" + "<body></body></html>"); ret str(buf); }
Began life as a copy of #1002142
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment