remove unnecessary deps
This commit is contained in:
parent
2478032e61
commit
ddfdaf3347
1578
Cargo.lock
generated
1578
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,4 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
hyper = "1.6.0"
|
||||
reqwest = "0.12.20"
|
||||
tokio = { version = "1.45.1", features = ["full"] }
|
||||
xml-rs = "0.8.26"
|
||||
|
@ -5,8 +5,6 @@ Keep the goal simple.
|
||||
|
||||
- just list the unread articles
|
||||
- Have a way to mark an article as read/unread
|
||||
https://www.rssboard.org/rss-specification
|
||||
|
||||
https://brycev.com/rss.xml
|
||||
- https://www.rssboard.org/rss-specification
|
||||
|
||||
|
||||
|
11
src/main.rs
11
src/main.rs
@ -4,7 +4,7 @@ pub mod error;
|
||||
pub mod parser;
|
||||
|
||||
fn main() -> Result<(), TrsError> {
|
||||
let bytes = include_bytes!("../sample/rss2.xml");
|
||||
let bytes = include_bytes!("../sample/rss.xml");
|
||||
let xml_source_stream = ParserConfig::new()
|
||||
.ignore_invalid_encoding_declarations(true)
|
||||
.create_reader(&bytes[..]);
|
||||
@ -14,7 +14,14 @@ fn main() -> Result<(), TrsError> {
|
||||
println!("{}", rss_channel.link);
|
||||
println!("{}", rss_channel.description);
|
||||
for article in &rss_channel.articles {
|
||||
println!("{} {:^50} {:<}", article.date, article.title, article.link);
|
||||
let max_title_chars = article.title.len().min(47);
|
||||
let max_link_chars = article.link.len().min(67);
|
||||
println!(
|
||||
"| {} | {:.<50} | {:.<70} |",
|
||||
article.date,
|
||||
&article.title[0..max_title_chars],
|
||||
&article.link[0..max_link_chars]
|
||||
);
|
||||
}
|
||||
|
||||
println!(
|
||||
|
Loading…
x
Reference in New Issue
Block a user