Merge pull request #6 from JosephKiranBabu/master
Strip utm parameters from web links
This commit is contained in:
commit
c39b71d025
1 changed files with 5 additions and 1 deletions
|
@ -119,13 +119,17 @@
|
||||||
(map parse-tweet)
|
(map parse-tweet)
|
||||||
(post-items last-post-time))))
|
(post-items last-post-time))))
|
||||||
|
|
||||||
|
(defn strip-utm [news-link]
|
||||||
|
(first
|
||||||
|
(string/split news-link #"\?utm")))
|
||||||
|
|
||||||
(defn parse-feed [last-post-time parser [title url]]
|
(defn parse-feed [last-post-time parser [title url]]
|
||||||
(-> (.parseURL parser url)
|
(-> (.parseURL parser url)
|
||||||
(.then #(post-items
|
(.then #(post-items
|
||||||
last-post-time
|
last-post-time
|
||||||
(for [{:keys [title isoDate pubDate content link]} (-> % js->edn :items)]
|
(for [{:keys [title isoDate pubDate content link]} (-> % js->edn :items)]
|
||||||
{:created-at (js/Date. (or isoDate pubDate))
|
{:created-at (js/Date. (or isoDate pubDate))
|
||||||
:text (str (trim-text title) "\n\n" link)})))))
|
:text (str (trim-text title) "\n\n" (strip-utm link))})))))
|
||||||
|
|
||||||
(get-mastodon-timeline
|
(get-mastodon-timeline
|
||||||
(fn [timeline]
|
(fn [timeline]
|
||||||
|
|
Reference in a new issue