Update regex
This commit is contained in:
parent
1002a57856
commit
285c140fcb
Binary file not shown.
|
@ -2,6 +2,7 @@
|
|||
:root {
|
||||
--color-black: black;
|
||||
--color-gray: gray;
|
||||
--color-background: #f9f7f1;
|
||||
--height-img: 10rem;
|
||||
}
|
||||
|
||||
|
@ -16,7 +17,7 @@ body {
|
|||
padding: 0;
|
||||
font-family: Newsreader, serif;
|
||||
color: var(--color-black);
|
||||
background-image: url("../img/background.jpg");
|
||||
background-color: var(--color-background);
|
||||
background-size: 100%;
|
||||
}
|
||||
img {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 265 KiB |
|
@ -43,7 +43,7 @@
|
|||
(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-first-image (second (re-find #"(<main|id=\".*main.*\"|class=\".*main.*\").*<img[^>]+src=\"([^\">]+)\"" html))
|
||||
url-first-image (second (re-find #"<main.*>[\s\S]*<img[^>]+src=\"([^\"\'|>]+)\"|id=[\'\"] ?main ?[\'\"]>[\s\S]*<img[^>]+src=\"([^\"\'|>]+)\"|class=[\'\"] ?main ?[\'\"]>[\s\S]*<img[^>]+src=\"([^\"\'|>]+)\"" html))
|
||||
images [url-og-image url-first-image]
|
||||
url-final-image (first (filter (fn [item] (not (nil? item))) images))]
|
||||
(assoc article :cover url-final-image))) articles))
|
||||
|
|
Loading…
Reference in New Issue