podal/src/feed/mod.rs

15 lines
364 B
Rust
Raw Normal View History

use crate::prelude::*;
use crate::network::NetworkEnv;
use atom_syndication::Feed;
2023-07-25 10:46:47 +01:00
mod find;
pub use find::find;
pub fn get(url: &str, e: &NetworkEnv) -> Result<Feed> {
let content = (e.fetch_as_bytes)(url).context(format!("Fetching feed: {}", url))?;
let channel = Feed::read_from(&content[..]).context("Could not parse RSS feed")?;
Ok(channel)
}