aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: 8c0ec892977b59d2cbcd099a1ebd8cc88c1e0697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 => "",
        }
    );
}