static Snippet createSnippet(Snippet s) { s.id = createSnippet(s.text, s.title, parseSnippetType(s.type)); ret s; } sS createSnippet(S text, S title, int type, bool isPublic default true) { ret createSnippet(text, title, type, standardCredentialsUser(), standardCredentialsPass(), isPublic); } sS createSnippet(S text, S title, int type, S user, S pass, bool isPublic default true) { S addURL = tb_mainServer() + "/tb-int/add_snippet.php"; Map query = litmap("type", type, "high", 1, "public", isPublic ? 1 : 0, "text", text, "name", title, "_user", user, "_pass", pass); S answer = doPost(query, addURL); if (!isSnippetID(answer)) fail(answer); print("Snippet created. " + formatSnippetID(answer)); ret formatSnippetID(answer); }