mirror of
https://github.com/tanrax/RSSPAPER.git
synced 2025-02-20 10:02:37 -05:00
Update feeds.clj
This commit is contained in:
parent
831ab88001
commit
4080ac1435
@ -42,8 +42,8 @@
|
|||||||
(map (fn [article]
|
(map (fn [article]
|
||||||
(let [url-article (get-in article [:feed :link])
|
(let [url-article (get-in article [:feed :link])
|
||||||
html (:body (client/get url-article {:insecure? true}))
|
html (:body (client/get url-article {:insecure? true}))
|
||||||
first-content (second (re-find #"<meta.*content=\"([^\">]+)\".*property=\"og:image(?::url)?\".*>" html))
|
first-content (second (re-find #"<meta[^>].*[^>]content=\"([^\">]+)\".*[^>]property=\"og:image(?::url)?\".*>" html))
|
||||||
second-content (second (re-find #"<meta.*property=\"og:image(?::url)?\".*content=\"([^\">]+)\".*>" html))
|
second-content (second (re-find #"<meta[^>].*[^>]property=\"og:image(?::url)?\".*[^>]content=\"([^\">]+)\".*>" html))
|
||||||
first-image (second (re-find #"<img[^>]+src=\"([^\">]+)\"" html))
|
first-image (second (re-find #"<img[^>]+src=\"([^\">]+)\"" html))
|
||||||
images [first-content second-content first-image]
|
images [first-content second-content first-image]
|
||||||
final-image (first (filter (fn [item] (not (nil? item))) images))]
|
final-image (first (filter (fn [item] (not (nil? item))) images))]
|
||||||
@ -74,4 +74,4 @@
|
|||||||
filter-edition
|
filter-edition
|
||||||
order-published
|
order-published
|
||||||
add-cover-article
|
add-cover-article
|
||||||
add-datetimes-formatter))
|
add-datetimes-formatter))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user