Update feeds.clj
This commit is contained in:
parent
d3e9f28e28
commit
a73f9dc161
|
@ -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))]
|
||||
|
|
Loading…
Reference in New Issue