2022-09-19 22:32:36 +03:00
|
|
|
/* snac - A simple, minimalistic ActivityPub instance */
|
|
|
|
/* copyright (c) 2022 grunfink - MIT license */
|
|
|
|
|
|
|
|
#include "xs.h"
|
|
|
|
|
|
|
|
#include "snac.h"
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2022-09-19 23:19:14 +03:00
|
|
|
snac snac;
|
|
|
|
|
|
|
|
printf("%s\n", tid());
|
|
|
|
|
2022-09-20 10:39:28 +03:00
|
|
|
srv_open("/home/angel/lib/snac/comam.es/");
|
2022-09-19 22:32:36 +03:00
|
|
|
|
2022-09-20 00:03:18 +03:00
|
|
|
user_open(&snac, "mike");
|
2022-09-20 10:48:13 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
xs *list = follower_list(&snac);
|
|
|
|
char *p, *obj;
|
|
|
|
|
|
|
|
p = list;
|
|
|
|
while (xs_list_iter(&p, &obj)) {
|
|
|
|
char *actor = xs_dict_get(obj, "actor");
|
|
|
|
printf("%s\n", actor);
|
|
|
|
}
|
|
|
|
}
|
2022-09-19 23:19:14 +03:00
|
|
|
|
2022-09-20 00:33:11 +03:00
|
|
|
{
|
|
|
|
xs *list = user_list();
|
|
|
|
char *p, *uid;
|
|
|
|
|
|
|
|
p = list;
|
|
|
|
while (xs_list_iter(&p, &uid)) {
|
2022-09-20 10:39:28 +03:00
|
|
|
if (user_open(&snac, uid)) {
|
|
|
|
printf("%s (%s)\n", uid, xs_dict_get(snac.config, "name"));
|
|
|
|
user_free(&snac);
|
|
|
|
}
|
2022-09-20 00:33:11 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-19 22:32:36 +03:00
|
|
|
return 0;
|
|
|
|
}
|