diff --git a/src/main.rs b/src/main.rs
index 11b18a3..3359029 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -12,7 +12,7 @@ mod cohost_posts;
mod syndication;
mod webfinger;
use cohost_account::{CohostAccount, COHOST_ACCOUNT_API_URL};
-use cohost_posts::{cohost_posts_api_url, CohostPostsPage};
+use cohost_posts::{cohost_posts_api_url, CohostPost, CohostPostsPage};
use webfinger::CohostWebfingerResource;
#[derive(Parser, Debug)]
@@ -46,6 +46,12 @@ fn index() -> RawHtml<&'static str> {
RawHtml(include_str!("../static/index.html"))
}
+#[derive(Responder)]
+#[response(content_type = "text/markdown")]
+struct MdResponse {
+ inner: String,
+}
+
#[derive(Responder)]
#[response(content_type = "application/rss+xml")]
struct RssResponse {
@@ -61,6 +67,28 @@ enum ErrorResponse {
InternalError(String),
}
+async fn get_post_from_page(
+ client: &mut Client,
+ project_id: &str,
+ post_id: u64,
+) -> Result/project_name/feed.rss
to get a feed for a project.
For example, /noracodes/feed.rss
will give you the feed for my page.
+ You can also get a particular post's original plain-text body at /project_name/post_id/
, such as
+ /noracodes/169186/
. (In a Cohost post URL, the ID is the numerical part after /post/
.
+ For instance, in https://cohost.org/noracodes/post/169186-october-update
, the ID is "169186".)
+
Webfinger resources for accounts are provided at the Webfinger well-known URL /.well-known/webfinger?project_name
.