Skip to content

Commit 6ad4caf

Browse files
init. prioritize logo then og image
1 parent 5d1e9c8 commit 6ad4caf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

backend/src/main/java/io/easystartup/suggestfeature/utils/WebPageExtractorUtil.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ private static String extractOrganizationName(Document doc) {
123123
}
124124

125125
private static String extractLogo(Document doc, String url) {
126-
// Try to extract from Open Graph meta tag
127-
String logo = doc.select("meta[property=og:image]").attr("content");
128-
if (!logo.isEmpty()) {
129-
return logo;
130-
}
131126

132127
// Try to extract from schema.org metadata
133128
Elements schema = doc.select("script[type=application/ld+json]");
@@ -170,6 +165,12 @@ private static String extractLogo(Document doc, String url) {
170165
}
171166
}
172167

168+
// Try to extract from Open Graph meta tag
169+
String logo = doc.select("meta[property=og:image]").attr("content");
170+
if (!logo.isEmpty()) {
171+
return logo;
172+
}
173+
173174
return null;
174175
}
175176

0 commit comments

Comments
 (0)