!7 sS botID = #1008316; // #1008533; sclass Msg { long time; bool fromUser; S text; *() {} *(bool *fromUser, S *text) { time = now(); } } concept Conversation { S cookie; long dialogID; new L msgs; void add(Msg m) { msgs.add(m); change(); } } p { S html = loadPage("http://ai1.lol/" + psI(botID) + "/raw/logs"); for (L li : html_contentsOfLIs(html)) { S dialogID = assertInteger(first(li)); print("\nDialog " + dialogID); new Conversation conv; conv.dialogID = parseLong(dialogID); for (L li2 : html_contentsOfLIs(li)) { S msg = htmldecode(join(li2)); new Msg m; if (msg.startsWith(">")) m.fromUser = true; else if (!msg.startsWith("<")) { warn("Unknown line: " + msg); continue; } m.text = trim(substring(msg, 1)); conv.add(m); printStruct(m); } } }