summaryrefslogtreecommitdiff
path: root/tweet-archive.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tweet-archive.pl')
-rw-r--r--tweet-archive.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/tweet-archive.pl b/tweet-archive.pl
index 1a7232b..38bb184 100644
--- a/tweet-archive.pl
+++ b/tweet-archive.pl
@@ -63,11 +63,14 @@ if ($conf->{misskey}) {
$client->client->ua->add_handler( response_done => sub { push @responses, $_[0]; return } );
try {
- my $latest_id = $store->latest_note_id;
+ my $latest_id = $store->latest_note_id // '0';
- for my $note ($client->timeline($latest_id)->@*) {
- $store->store_note($note);
- }
+ $client->timeline(
+ $latest_id,
+ sub($notes) {
+ $store->store_note($_) for $notes->@*;
+ },
+ );
$store->store_misskey_following($client->following);
$store->store_misskey_followers($client->followers);