diff --git a/src/main.rs b/src/main.rs index 4327f8c..a0e3cb6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,6 +83,7 @@ impl FediClient { async fn get_related_users(&self, user_id: &str, relation: &str) -> reqwest::Result> { let mut out = Vec::new(); + let mut max_id = String::new(); let limit = 40; // TODO make it customizable? idk loop { let mut page : Vec = self.http @@ -90,12 +91,16 @@ impl FediClient { .headers(self.headers()) .query(&[("limit", limit)]) .query(&[("with_relationships", true)]) + .query(&[("max_id", &max_id)]) .send() .await? .error_for_status()? .json() .await?; let count = page.len(); + if let Some(u) = page.last() { + max_id = u.id.clone(); + } out.append(&mut page); // TODO can i just concat these vecs at the end? if count != limit { break } // end of pages }