2023-07-25 14:47:33 +01:00
|
|
|
use crate::prelude::*;
|
|
|
|
|
2023-07-29 20:36:03 +01:00
|
|
|
use crate::network::NetworkEnv;
|
|
|
|
use atom_syndication::Feed;
|
2023-07-28 18:35:41 +01:00
|
|
|
|
2023-07-25 10:46:47 +01:00
|
|
|
mod find;
|
|
|
|
|
2023-07-25 14:47:33 +01:00
|
|
|
pub use find::find;
|
|
|
|
|
2023-07-29 20:36:03 +01:00
|
|
|
pub fn get(url: &str, e: &NetworkEnv) -> Result<Feed> {
|
2023-08-13 16:11:16 +01:00
|
|
|
let content = (e.fetch_as_bytes)(url).context(format!("Fetching feed: {}", url))?;
|
|
|
|
let channel = Feed::read_from(&content[..]).context("Could not parse RSS feed")?;
|
2023-07-29 20:36:03 +01:00
|
|
|
Ok(channel)
|
2023-07-28 18:35:41 +01:00
|
|
|
}
|