From afdeca4e37ca3f5639d8e939b2dd92b74b6c39b3 Mon Sep 17 00:00:00 2001 From: Felisp Date: Thu, 22 Aug 2024 02:55:21 +0200 Subject: [PATCH] Separate ``target`` to additional ``host`` field So that we could actually generate proper urls --- res/ExampleConfig-documented.edn | 6 +++++- src/rss_thread_watch/feed_generator.clj | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/res/ExampleConfig-documented.edn b/res/ExampleConfig-documented.edn index 87d2a8f..0d3c127 100644 --- a/res/ExampleConfig-documented.edn +++ b/res/ExampleConfig-documented.edn @@ -15,9 +15,13 @@ ;; Default ChOD to use if none is specified by the user :default-chod 94 ;; If you want to do some preprocessing beforehand, you can override - ;; Target URL for the board, but the response must be same the 4chan API would return + ;; target URL for the board, but the response must be same the 4chan API would return ;; /$board/catalog.json will be appended to this link + ;; This is target for API requests :target "https://api.4chan.org" + ;; This host that has the actual threads, /board/thread-no will be appeneded + ;; to this + :host "https://boards.4chan.org" ;; Commented parts bellow are still unimplemented ;; ------ ;; Only download catalog when someone requests feed and cache is old diff --git a/src/rss_thread_watch/feed_generator.clj b/src/rss_thread_watch/feed_generator.clj index 83a92a8..63a5f5d 100644 --- a/src/rss_thread_watch/feed_generator.clj +++ b/src/rss_thread_watch/feed_generator.clj @@ -103,7 +103,7 @@ :description "RSS based thread watcher"} body (map #(thread-to-rss-item %1 - (get board-config :target) + (get board-config :host) (get board-config :name)) items)] (rss/channel-xml head body)))