mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Also export following_accounts.csv.
This commit is contained in:
parent
53f339abf6
commit
7a83532c8e
1 changed files with 25 additions and 0 deletions
25
utils.c
25
utils.c
|
@ -653,6 +653,31 @@ void export_csv(snac *user)
|
|||
}
|
||||
else
|
||||
snac_log(user, xs_fmt("Cannot create file %s", fn));
|
||||
|
||||
fn = "following_accounts.csv";
|
||||
if ((f = fopen(fn, "w")) != NULL) {
|
||||
snac_log(user, xs_fmt("Creating %s...", fn));
|
||||
|
||||
fprintf(f, "Account address,Show boosts,Notify on new posts,Languages\n");
|
||||
|
||||
xs *fwing = following_list(user);
|
||||
const char *actor;
|
||||
|
||||
xs_list_foreach(fwing, actor) {
|
||||
xs *uid = NULL;
|
||||
int status;
|
||||
|
||||
if (valid_status((status = webfinger_request(actor, NULL, &uid)))) {
|
||||
fprintf(f, "%s,%s,false,\n", uid, limited(user, actor, 0) ? "false" : "true");
|
||||
}
|
||||
else
|
||||
snac_log(user, xs_fmt("Error resolving followed account %s %d", actor, status));
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
snac_log(user, xs_fmt("Cannot create file %s", fn));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue