diff --git a/src/content/assets/css/style.css b/src/content/assets/css/style.css
index 0d409db..87a9198 100644
--- a/src/content/assets/css/style.css
+++ b/src/content/assets/css/style.css
@@ -141,3 +141,9 @@ a.post-menu-link {
text-decoration: none;
color: green;
}
+
+.rss-logo {
+ height: 30px;
+ width: auto;
+ float: right;
+}
diff --git a/src/content/assets/img/atom.svg b/src/content/assets/img/atom.svg
new file mode 100644
index 0000000..b325149
--- /dev/null
+++ b/src/content/assets/img/atom.svg
@@ -0,0 +1,18 @@
+
+
+
diff --git a/src/permap.ml b/src/permap.ml
index bd166d8..90af8a6 100644
--- a/src/permap.ml
+++ b/src/permap.ml
@@ -288,6 +288,16 @@ let babillard_post request =
| `Wrong_session _ | `Wrong_content_type ->
Dream.empty `Bad_Request )
+let thread_feed_get request =
+ let thread_id = Dream.param request "thread_id" in
+ if Babillard.thread_exist thread_id then
+ let feed = Pp_babillard.feed thread_id in
+ match feed with
+ | Error e -> render_unsafe e request
+ | Ok feed ->
+ Dream.respond ~headers:[ ("Content-Type", "application/atom+xml") ] feed
+ else Dream.respond ~status:`Not_Found "Thread not found"
+
let thread_get request =
let thread_id = Dream.param request "thread_id" in
if Babillard.thread_exist thread_id then
@@ -371,6 +381,7 @@ let routes =
; post "/report/:post_id" report_post
; get_ "/thread/:thread_id" thread_get
; post "/thread/:thread_id" reply_post
+ ; get_ "/thread/:thread_id/feed" thread_feed_get
; get_ "/user" user
; get_ "/user/:user" user_profile
; get_ "/user/:user/avatar" avatar_image
diff --git a/src/pp_babillard.ml b/src/pp_babillard.ml
index ac21946..4dfc3ad 100644
--- a/src/pp_babillard.ml
+++ b/src/pp_babillard.ml
@@ -271,3 +271,59 @@ let get_markers () =
ops
in
Ok markers
+
+(* TODO get from config file? *)
+let server_url = "http://localhost:3696"
+
+(* RFC-3339 date-time *)
+let pp_date fmt date =
+ let date = Unix.gmtime date in
+ Format.fprintf fmt "%04d-%02d-%02dT%02d:%02d:%02dZ" (1900 + date.tm_year)
+ (1 + date.tm_mon) date.tm_mday date.tm_hour date.tm_min date.tm_sec
+
+let pp_feed_entry fmt post =
+ Format.fprintf fmt
+ {|
+