fix: get name by url and not by title
This commit is contained in:
parent
01911ebb4f
commit
974d5e402a
1 changed files with 9 additions and 1 deletions
10
src/parse.rs
10
src/parse.rs
|
@ -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
|
||||||
|
|
Reference in a new issue