diff options
| author | 2022-10-03 19:17:12 +0200 | |
|---|---|---|
| committer | 2022-10-03 19:17:12 +0200 | |
| commit | 5994b4a313ec178e1fe3487712a3d000573dd9e2 (patch) | |
| tree | bf056251d28734711e4febe3892d1f15ae8d4e9e | |
| parent | Deleted debugging code. (diff) | |
| download | penes-snac2-5994b4a313ec178e1fe3487712a3d000573dd9e2.tar.gz penes-snac2-5994b4a313ec178e1fe3487712a3d000573dd9e2.tar.xz penes-snac2-5994b4a313ec178e1fe3487712a3d000573dd9e2.zip | |
Version 2.01 RELEASED.2.01
| -rw-r--r-- | main.c | 83 | ||||
| -rw-r--r-- | snac.h | 2 |
2 files changed, 2 insertions, 83 deletions
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | int usage(void) | 11 | int usage(void) |
| 12 | { | 12 | { |
| 13 | printf("snac - A simple, minimalistic ActivityPub instance\n"); | 13 | printf("snac " VERSION " - A simple, minimalistic ActivityPub instance\n"); |
| 14 | printf("Copyright (c) 2022 grunfink - MIT license\n"); | 14 | printf("Copyright (c) 2022 grunfink - MIT license\n"); |
| 15 | printf("\n"); | 15 | printf("\n"); |
| 16 | printf("Commands:\n"); | 16 | printf("Commands:\n"); |
| @@ -229,84 +229,3 @@ int main(int argc, char *argv[]) | |||
| 229 | 229 | ||
| 230 | return 0; | 230 | return 0; |
| 231 | } | 231 | } |
| 232 | |||
| 233 | |||
| 234 | #if 0 | ||
| 235 | { | ||
| 236 | snac snac; | ||
| 237 | |||
| 238 | printf("%s\n", tid(0)); | ||
| 239 | |||
| 240 | srv_open("/home/angel/lib/snac/comam.es/"); | ||
| 241 | |||
| 242 | user_open(&snac, "mike"); | ||
| 243 | |||
| 244 | xs *headers = xs_dict_new(); | ||
| 245 | int status; | ||
| 246 | d_char *payload; | ||
| 247 | int p_size; | ||
| 248 | xs *response; | ||
| 249 | |||
| 250 | response = http_signed_request(&snac, "GET", "https://mastodon.social/users/VictorMoral", | ||
| 251 | headers, NULL, 0, &status, &payload, &p_size); | ||
| 252 | |||
| 253 | { | ||
| 254 | xs *j1 = xs_json_dumps_pp(response, 4); | ||
| 255 | printf("response:\n%s\n", j1); | ||
| 256 | printf("payload:\n%s\n", payload); | ||
| 257 | } | ||
| 258 | |||
| 259 | { | ||
| 260 | xs *list = queue(&snac); | ||
| 261 | char *p, *fn; | ||
| 262 | |||
| 263 | p = list; | ||
| 264 | while (xs_list_iter(&p, &fn)) { | ||
| 265 | xs *obj; | ||
| 266 | |||
| 267 | obj = dequeue(&snac, fn); | ||
| 268 | printf("%s\n", xs_dict_get(obj, "actor")); | ||
| 269 | } | ||
| 270 | } | ||
| 271 | |||
| 272 | #if 0 | ||
| 273 | { | ||
| 274 | xs *list = follower_list(&snac); | ||
| 275 | char *p, *obj; | ||
| 276 | |||
| 277 | p = list; | ||
| 278 | while (xs_list_iter(&p, &obj)) { | ||
| 279 | char *actor = xs_dict_get(obj, "actor"); | ||
| 280 | printf("%s\n", actor); | ||
| 281 | } | ||
| 282 | } | ||
| 283 | |||
| 284 | { | ||
| 285 | xs *list = timeline_list(&snac); | ||
| 286 | char *p, *fn; | ||
| 287 | |||
| 288 | p = list; | ||
| 289 | while (xs_list_iter(&p, &fn)) { | ||
| 290 | xs *tle = timeline_get(&snac, fn); | ||
| 291 | |||
| 292 | printf("%s\n", xs_dict_get(tle, "id")); | ||
| 293 | } | ||
| 294 | } | ||
| 295 | |||
| 296 | { | ||
| 297 | xs *list = user_list(); | ||
| 298 | char *p, *uid; | ||
| 299 | |||
| 300 | p = list; | ||
| 301 | while (xs_list_iter(&p, &uid)) { | ||
| 302 | if (user_open(&snac, uid)) { | ||
| 303 | printf("%s (%s)\n", uid, xs_dict_get(snac.config, "name")); | ||
| 304 | user_free(&snac); | ||
| 305 | } | ||
| 306 | } | ||
| 307 | } | ||
| 308 | #endif | ||
| 309 | |||
| 310 | return 0; | ||
| 311 | } | ||
| 312 | #endif | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* snac - A simple, minimalistic ActivityPub instance */ | 1 | /* snac - A simple, minimalistic ActivityPub instance */ |
| 2 | /* copyright (c) 2022 grunfink - MIT license */ | 2 | /* copyright (c) 2022 grunfink - MIT license */ |
| 3 | 3 | ||
| 4 | #define VERSION "2.0001" | 4 | #define VERSION "2.01" |
| 5 | 5 | ||
| 6 | #define USER_AGENT "snac/" VERSION | 6 | #define USER_AGENT "snac/" VERSION |
| 7 | 7 | ||