static Snippet createSnippet(Snippet s) { s.id = createSnippet(s.text, s.title, parseSnippetType(s.type)); ret s; } static S createSnippet(S text, S title, int type) { ret createSnippet(text, title, type, standardCredentialsUser(), standardCredentialsPass()); } static S createSnippet(S text, S title, int type, S user, S pass) { S addURL = "http://tinybrain.de:8080/tb-int/add_snippet.php"; Map query = litmap("type", type, "high", 1, "public", 1, "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); }