cool - rss now works :-)

This commit is contained in:
jem 2020-05-31 20:08:55 +02:00
parent 21467128a6
commit 3f59652d05
2 changed files with 4 additions and 4 deletions

View file

@ -15,8 +15,8 @@
[] []
(rss.)) (rss.))
(defn parse-feed [payload] (defn parse-feed [item]
(for [{:keys [title isoDate pubDate content link]} (:items payload)] (let [{:keys [title isoDate pubDate content link]} item]
{:created-at (js/Date. (or isoDate pubDate)) {:created-at (js/Date. (or isoDate pubDate))
:text (str title :text (str title
"\n\n" "\n\n"

View file

@ -172,13 +172,13 @@
(let [{:keys [source target resolve-urls?]} transformation] (let [{:keys [source target resolve-urls?]} transformation]
(fn [payload] (fn [payload]
(->> (infra/js->edn payload) (->> (infra/js->edn payload)
(:items)
(map rss/parse-feed) (map rss/parse-feed)
(debug)
(filter #(> (:created-at %) last-post-time)) (filter #(> (:created-at %) last-post-time))
(remove #(blocked-content? transformation (:text %))) (remove #(blocked-content? transformation (:text %)))
(map #(intermediate-resolve-urls resolve-urls? %)) (map #(intermediate-resolve-urls resolve-urls? %))
(map #(twitter/nitter-url source %))
(map #(perform-replacements transformation %)) (map #(perform-replacements transformation %))
(debug)
(map #(intermediate-to-mastodon mastodon-auth target %)) (map #(intermediate-to-mastodon mastodon-auth target %))
(masto/post-items mastodon-auth target last-post-time))))) (masto/post-items mastodon-auth target last-post-time)))))