diff options
| author | njaremko | 2017-07-17 00:28:18 -0400 |
|---|---|---|
| committer | njaremko | 2017-07-17 00:28:18 -0400 |
| commit | 3483b857cf687fe3d1568b82ca7bb8ffec938a7c (patch) | |
| tree | 76fa8948da2b919c79e66d23617c3076ccb90fd2 /src/main.rs | |
| download | podcast-3483b857cf687fe3d1568b82ca7bb8ffec938a7c.tar.bz2 | |
First commit
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..8c0ec89 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,26 @@ +extern crate rss; + +mod structs; + +use std::fs::File; +use std::io::BufReader; +use rss::{Channel, Item}; +use structs::*; + +fn main() { + let file = File::open("rss.xml").unwrap(); + let channel = Channel::read_from(BufReader::new(file)).unwrap(); + let podcast = Podcast::from(channel); + + for title in podcast.list_titles() { + println!("{}", title); + } + let ep = &podcast.episodes()[0]; + println!( + "{}", + match ep.download_url() { + Some(val) => val, + None => "", + } + ); +} |
