diff --git a/src/main.rs b/src/main.rs index 76e9737..cfd7ada 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,9 +4,7 @@ use std::error::Error; #[macro_use] extern crate rocket; use cached::proc_macro::cached; -use http_cache_reqwest::{CACacheManager, Cache, CacheMode, HttpCache}; -use reqwest::StatusCode; -use reqwest_middleware::{ClientBuilder, ClientWithMiddleware}; +use reqwest::{Client, StatusCode}; use rocket::response::content::RawHtml; use rocket::serde::json::Json; @@ -43,19 +41,11 @@ fn user_agent() -> String { } static ARGS: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| Args::parse()); -static CLIENT: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { - ClientBuilder::new( - reqwest::Client::builder() - .user_agent(user_agent()) - .build() - .unwrap(), - ) - .with(Cache(HttpCache { - mode: CacheMode::Default, - manager: CACacheManager::default(), - options: None, - })) - .build() +static CLIENT: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { + reqwest::Client::builder() + .user_agent(user_agent()) + .build() + .unwrap() }); #[get("/")] diff --git a/src/syndication.rs b/src/syndication.rs index 4384686..f249d50 100644 --- a/src/syndication.rs +++ b/src/syndication.rs @@ -1,23 +1,8 @@ use crate::cohost_account::CohostAccount; use crate::cohost_posts::*; use crate::ARGS; -use atom_syndication::LinkBuilder; -use rss::extension::atom::{AtomExtensionBuilder, Link}; use rss::Channel; -fn rel_link_for(rel: &str, project_name: &str, page_number: u64) -> Link { - LinkBuilder::default() - .rel(rel) - .href(format!( - "https://{}{}{}/feed.rss?page={}", - &ARGS.domain, - &ARGS.base_url, - project_name.clone(), - page_number - )) - .build() -} - pub fn channel_for_posts_page( project_name: impl AsRef, project: CohostAccount, @@ -40,15 +25,6 @@ pub fn channel_for_posts_page( ))) .link(format!("https://cohost.org/{}", project_name,)); - let mut atom = AtomExtensionBuilder::default(); - let links = vec![ - rel_link_for("self", project_name, 0), - rel_link_for("first", project_name, 0), - ]; - atom.links(links); - - builder.atom_ext(Some(atom.build())); - page.items.sort_by_key(|item| item.published_at); let mut items = Vec::with_capacity(page.number_items); for item in page.items { diff --git a/static/index.html b/static/index.html index a5991fa..592bf2e 100644 --- a/static/index.html +++ b/static/index.html @@ -77,7 +77,6 @@
  • Project/account data for 60 seconds
  • Individual posts for 60 seconds
  • Whole RSS feeds for 120 seconds
  • -
  • Internal HTTP responses according to Cohost's settings
  • This means that if you update a post and then immediately request its source, you might get the old source. Just wait a few seconds.