svoid gazelle_mathBot1(S _user, S _botToken) { Map _result = cast postJSONPage("https://gazelle.rocks/bot/listPosts", +_user, +_botToken, fields := "text"); L posts = cast _result.get("result"); //pnl(posts); print("Found " + n2(posts, "total post")); for (Map post : posts) { Number postID = cast post.get("id"); S text = cast post.get("text"); LS groups = regexpGroupsIC("What is (\\d)\\+(\\d+)", text); if (empty(groups)) continue; print("Processing post " + postID + ": " + quote(text)); BigInt result = plus(parseBigInt(first(groups)), parseBigInt(second(groups))); print("Calculated result: " + result); print(postJSONPage("https://gazelle.rocks/bot/createPost", +_user, +_botToken, refs := postID, text := "The result is " + result, type := "Answer", botInfo := "Math bot")); } }