mirror of
https://github.com/tanrax/RSSPAPER.git
synced 2025-04-07 21:25:42 -04:00
Update regex
This commit is contained in:
parent
1002a57856
commit
285c140fcb
Binary file not shown.
@ -2,6 +2,7 @@
|
|||||||
:root {
|
:root {
|
||||||
--color-black: black;
|
--color-black: black;
|
||||||
--color-gray: gray;
|
--color-gray: gray;
|
||||||
|
--color-background: #f9f7f1;
|
||||||
--height-img: 10rem;
|
--height-img: 10rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ body {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
font-family: Newsreader, serif;
|
font-family: Newsreader, serif;
|
||||||
color: var(--color-black);
|
color: var(--color-black);
|
||||||
background-image: url("../img/background.jpg");
|
background-color: var(--color-background);
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 265 KiB |
@ -43,7 +43,7 @@
|
|||||||
(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}))
|
||||||
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))
|
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]
|
images [url-og-image url-first-image]
|
||||||
url-final-image (first (filter (fn [item] (not (nil? item))) images))]
|
url-final-image (first (filter (fn [item] (not (nil? item))) images))]
|
||||||
(assoc article :cover url-final-image))) articles))
|
(assoc article :cover url-final-image))) articles))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user