Update feeds.clj

This commit is contained in:
Andros Fenollosa 2021-07-31 14:35:30 +02:00
parent d3e9f28e28
commit a73f9dc161
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@
(map (fn [article]
(let [url-article (get-in article [:feed :link])
html (:body (client/get url-article {:insecure? true}))
url-og-image (second (re-find #"<meta[^>].*?[^>]property=\"og:image(?::url)?\".*?[^>]content=\"(.*?)\".*?>|<meta[^>].*?[^>]content=\"(.*?)\".*?[^>]property=\"og:image(?::url)?\".*?>" html))
url-og-image (second (re-find #"<meta[^>].*?property=\"og:image(?::url)?\".*?content=\"(.*?)\".*?>|<meta[^>].*?content=\"(.*?)\".*?property=\"og:image(?::url)?\".*?>" html))
url-first-image (second (re-find #"(<main|id=\".*main.*\"|class=\".*main.*\").*<img[^>]+src=\"([^\">]+)\"" html))
images [url-og-image url-first-image]
url-final-image (first (filter (fn [item] (not (nil? item))) images))]