fix: get name by url and not by title

This commit is contained in:
Mylloon 2022-09-03 14:41:16 +02:00
parent 01911ebb4f
commit 974d5e402a
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -17,7 +17,15 @@ pub async fn get_posts(scheme: String, username: String, domain: String) -> (Str
// Get the name of them and push them into the vector // Get the name of them and push them into the vector
let mut posts = Vec::new(); let mut posts = Vec::new();
for link in raw_posts.select(&Selector::parse("a").unwrap()) { for link in raw_posts.select(&Selector::parse("a").unwrap()) {
posts.push(link.inner_html()); posts.push(
link.value()
.attr("href")
.unwrap()
.split('/')
.last()
.unwrap()
.to_owned(),
);
} }
// Return the vector // Return the vector