From 54f2a1bc530f59bb95178932f4d76c8e59d8c86f Mon Sep 17 00:00:00 2001 From: Anson Date: Fri, 22 Aug 2025 23:34:32 -0600 Subject: [PATCH] Fix RSS feed parsing by reading from local artifacts - Change fetch_feed to read from local file instead of HTTP request - Update feed path to use ../public/index.xml from GitLab CI artifacts - Add better error messages for file reading and parsing failures - Resolves ParseError(NoFeedRoot) by avoiding 404 from live website --- ghost-upload/src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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