mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
Version 2.01 RELEASED.
This commit is contained in:
parent
e285f641b4
commit
5994b4a313
2 changed files with 2 additions and 83 deletions
83
main.c
83
main.c
|
@ -10,7 +10,7 @@
|
|||
|
||||
int usage(void)
|
||||
{
|
||||
printf("snac - A simple, minimalistic ActivityPub instance\n");
|
||||
printf("snac " VERSION " - A simple, minimalistic ActivityPub instance\n");
|
||||
printf("Copyright (c) 2022 grunfink - MIT license\n");
|
||||
printf("\n");
|
||||
printf("Commands:\n");
|
||||
|
@ -229,84 +229,3 @@ int main(int argc, char *argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
{
|
||||
snac snac;
|
||||
|
||||
printf("%s\n", tid(0));
|
||||
|
||||
srv_open("/home/angel/lib/snac/comam.es/");
|
||||
|
||||
user_open(&snac, "mike");
|
||||
|
||||
xs *headers = xs_dict_new();
|
||||
int status;
|
||||
d_char *payload;
|
||||
int p_size;
|
||||
xs *response;
|
||||
|
||||
response = http_signed_request(&snac, "GET", "https://mastodon.social/users/VictorMoral",
|
||||
headers, NULL, 0, &status, &payload, &p_size);
|
||||
|
||||
{
|
||||
xs *j1 = xs_json_dumps_pp(response, 4);
|
||||
printf("response:\n%s\n", j1);
|
||||
printf("payload:\n%s\n", payload);
|
||||
}
|
||||
|
||||
{
|
||||
xs *list = queue(&snac);
|
||||
char *p, *fn;
|
||||
|
||||
p = list;
|
||||
while (xs_list_iter(&p, &fn)) {
|
||||
xs *obj;
|
||||
|
||||
obj = dequeue(&snac, fn);
|
||||
printf("%s\n", xs_dict_get(obj, "actor"));
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
xs *list = timeline_list(&snac);
|
||||
char *p, *fn;
|
||||
|
||||
p = list;
|
||||
while (xs_list_iter(&p, &fn)) {
|
||||
xs *tle = timeline_get(&snac, fn);
|
||||
|
||||
printf("%s\n", xs_dict_get(tle, "id"));
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
xs *list = user_list();
|
||||
char *p, *uid;
|
||||
|
||||
p = list;
|
||||
while (xs_list_iter(&p, &uid)) {
|
||||
if (user_open(&snac, uid)) {
|
||||
printf("%s (%s)\n", uid, xs_dict_get(snac.config, "name"));
|
||||
user_free(&snac);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
2
snac.h
2
snac.h
|
@ -1,7 +1,7 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
|
||||
#define VERSION "2.0001"
|
||||
#define VERSION "2.01"
|
||||
|
||||
#define USER_AGENT "snac/" VERSION
|
||||
|
||||
|
|
Loading…
Reference in a new issue