remove rss dep

This commit is contained in:
philipp 2023-05-24 09:05:07 +02:00
parent fbdb7c0c32
commit bfdc815a36
2 changed files with 9 additions and 11 deletions

View File

@ -16,4 +16,3 @@ serde = { version = "1.0", features = [ "derive" ]}
serde_json = "1.0"
chrono = { version = "0.4", features = ["serde"]}
tera = { version = "1.18", features = ["date-locale"]}
rss = "2.0"

View File

@ -32,17 +32,16 @@ LIMIT 1000
}
pub async fn generate_feed(db: &SqlitePool) -> String {
let mut channel = ChannelBuilder::default()
.title("Ruder App Admin Feed")
.description("An RSS feed with activities from app.rudernlinz.at")
.build();
let mut items: Vec<Item> = vec![];
let mut ret = String::from("<?xml version=\"1.0\" encoding=\"utf-8\"?>
<rss version=\"2.0\">
<channel>
<title>Ruder App Admin Feed</title>
<description>An RSS feed with activities from app.rudernlinz.at</description>");
for log in Self::last(db).await {
let mut item = Item::default();
item.set_title(format!("({}) {}", log.created_at, log.msg));
items.append(&mut vec![item]);
ret.push_str("<item>");
ret.push_str(&format!("({}) {}", log.created_at, log.msg));
ret.push_str("</item>");
}
channel.set_items(items);
channel.to_string()
ret
}
}