From 55788ace47b89b265b39af3015bb41d094512c39 Mon Sep 17 00:00:00 2001 From: synt-xerror <169557594+synt-xerror@users.noreply.github.com> Date: Thu, 19 Feb 2026 02:21:09 -0300 Subject: [PATCH] Example files --- example.c | 31 +++++++++++++++++++++++++++++++ test.txt | 1 + 2 files changed, 32 insertions(+) create mode 100644 example.c create mode 100644 test.txt diff --git a/example.c b/example.c new file mode 100644 index 0000000..5321ea8 --- /dev/null +++ b/example.c @@ -0,0 +1,31 @@ +#include +#include "neocities.h" +#include + +int main() { + static const char* username = "errorsyntax"; + static const char* api_key = "859d457a6c9271b18c40a8540b314276"; + + char* out = NULL; + + // GET /api/info + if (neocities_info(username, &out) == 0) printf("%s", out); + free(out); + + // GET /api/list + if (neocities_list(api_key, "/", &out) == 0) printf("%s", out); + free(out); + + static const char* files[] = { "test.txt" }; + static const int qnt_files = sizeof(files) / sizeof(files[0]); + + // GET /api/upload + if (neocities_upload(api_key, files, files, qnt_files, &out) == 0) printf("%s", out); + free(out); + + // GET /api/delete + if (neocities_delete(api_key, files, qnt_files, &out) == 0) printf("%s", out); + free(out); + + return 0; +} diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..f718fdc --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +hellooo