diff options
| author | 2024-05-08 16:43:02 +0200 | |
|---|---|---|
| committer | 2024-05-08 16:43:02 +0200 | |
| commit | 979f2ad1400111bcd36da980ba8f78f25bb5390e (patch) | |
| tree | 1a2e4d76bf54633fad3beb307bf2612991eac8e3 /main.c | |
| parent | Minor tweaks to content_search(). (diff) | |
| download | penes-snac2-979f2ad1400111bcd36da980ba8f78f25bb5390e.tar.gz penes-snac2-979f2ad1400111bcd36da980ba8f78f25bb5390e.tar.xz penes-snac2-979f2ad1400111bcd36da980ba8f78f25bb5390e.zip | |
Rewritten content_search() to read from both timelines.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 22 |
1 files changed, 1 insertions, 21 deletions
| @@ -376,30 +376,10 @@ int main(int argc, char *argv[]) | |||
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | if (strcmp(cmd, "search") == 0) { /** **/ | 378 | if (strcmp(cmd, "search") == 0) { /** **/ |
| 379 | xs *tl = timeline_simple_list(&snac, "private", 0, XS_ALL); | ||
| 380 | int to; | 379 | int to; |
| 381 | 380 | ||
| 382 | /* 'url' contains the regex */ | 381 | /* 'url' contains the regex */ |
| 383 | xs *r = content_search(&snac, tl, url, 10, &to); | 382 | xs *r = content_search(&snac, url, 1, 10, &to); |
| 384 | |||
| 385 | int c = 0; | ||
| 386 | char *v; | ||
| 387 | |||
| 388 | /* print results as standalone links */ | ||
| 389 | while (xs_list_next(r, &v, &c)) { | ||
| 390 | printf("%s/admin/p/%s\n", snac.actor, v); | ||
| 391 | } | ||
| 392 | |||
| 393 | return 0; | ||
| 394 | } | ||
| 395 | |||
| 396 | if (strcmp(cmd, "search2") == 0) { /** **/ | ||
| 397 | /* undocumented (for testing only) */ | ||
| 398 | xs *tl = timeline_simple_list(&snac, "public", 0, XS_ALL); | ||
| 399 | int to; | ||
| 400 | |||
| 401 | /* 'url' contains the regex */ | ||
| 402 | xs *r = content_search(&snac, tl, url, 10, &to); | ||
| 403 | 383 | ||
| 404 | int c = 0; | 384 | int c = 0; |
| 405 | char *v; | 385 | char *v; |