diff --git a/ghost-upload/src/main.rs b/ghost-upload/src/main.rs index 90531ce..fe4601a 100644 --- a/ghost-upload/src/main.rs +++ b/ghost-upload/src/main.rs @@ -227,10 +227,11 @@ async fn get_existing_post_id(slug: &str, token: &str) -> Option { } } -async fn fetch_feed(url: &str) -> Vec { - let content = reqwest::get(url).await.unwrap().text().await.unwrap(); +async fn fetch_feed(path: &str) -> Vec { + // Read from local file instead of HTTP request + let content = std::fs::read_to_string(path).expect("Failed to read RSS feed file"); - let feed = parser::parse(content.as_bytes()).unwrap(); + let feed = parser::parse(content.as_bytes()).expect("Failed to parse RSS feed"); feed.entries } @@ -296,7 +297,7 @@ async fn main() { - let feed = "https://projects.ansonbiggs.com/index.xml"; + let feed = "../public/index.xml"; // Split the key into ID and SECRET let (id, secret) = ghost_admin_api_key