From b440f37d0bb9039601767a6cb57b0790fd7d0036 Mon Sep 17 00:00:00 2001 From: Marthym Date: Sun, 27 Aug 2023 10:17:24 +0200 Subject: [PATCH] chore(sandside): upgrade scraphead to 1.4.1 --- pom.xml | 2 +- .../scraper/domain/filters/OpenGraphFilter.java | 16 ++++++++++++---- .../techwatch/components/newslist/NewsCard.vue | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index d9a83279..02277212 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 1.5.5.Final 9.31 1.9.0 - 1.4.0 + 1.4.1 1.6.1 5.2.1 1.1.6.RELEASE diff --git a/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/OpenGraphFilter.java b/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/OpenGraphFilter.java index 8104c3b9..5ffab08c 100644 --- a/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/OpenGraphFilter.java +++ b/sandside/src/main/java/fr/ght1pc9kc/baywatch/scraper/domain/filters/OpenGraphFilter.java @@ -71,15 +71,23 @@ private RawNews handleMetaData(RawNews news, Metas metas) { raw = raw.withTitle(metas.title()); } + if (!metas.errors().isEmpty()) { + metas.errors().forEach(e -> log.atDebug() + .addArgument(e.getLocalizedMessage()) + .addArgument(news.link()) + .setMessage("Error when parsing headers: {} on {}") + .log()); + } OpenGraph og = metas.og(); if (nonNull(og) && !og.isEmpty()) { - raw = Optional.ofNullable(og.title).map(raw::withTitle).orElse(raw); - raw = Optional.ofNullable(og.description).map(raw::withDescription).orElse(raw); - raw = Optional.ofNullable(og.image) + raw = Optional.ofNullable(og.title()).map(raw::withTitle).orElse(raw); + raw = Optional.ofNullable(og.description()).map(raw::withDescription).orElse(raw); + raw = Optional.ofNullable(og.image()) .filter(i -> SUPPORTED_SCHEMES.contains(i.getScheme())) .map(raw::withImage).orElse(raw); } else { - log.debug("No OG meta found for {}", news.link()); + log.atDebug().addArgument(news.link()) + .setMessage("No OG meta found for {}").log(); } if (nonNull(links) && isNull(raw.image())) { diff --git a/seaside/src/techwatch/components/newslist/NewsCard.vue b/seaside/src/techwatch/components/newslist/NewsCard.vue index ca3182c9..c2fb4bbe 100644 --- a/seaside/src/techwatch/components/newslist/NewsCard.vue +++ b/seaside/src/techwatch/components/newslist/NewsCard.vue @@ -23,7 +23,7 @@
+ @click="$emit('clickTitle')" v-html="card.data.title">