feedkeeper 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/dist/feeds/content/patterns/snippet-metadata/de.js +1 -0
- package/server/dist/feeds/content/patterns/snippet-metadata/en.js +1 -0
- package/server/dist/feeds/content/patterns/snippet-metadata/index.js +7 -4
- package/server/dist/feeds/content/patterns/snippet-metadata/ja.js +1 -0
- package/server/dist/feeds/contentNoise.js +14 -2
- package/server/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/** Whole bylines with an explicit timestamp, only ahead of the first editorial line. */
|
|
2
2
|
export default [/^von\s+[^.!?\n]{2,60}\s+[I|·–—-]\s+\d{1,2}\.\d{1,2}\.\d{2,4}\s*[-–|·]\s*\d{1,2}:\d{2}$/iu];
|
|
3
|
+
export const markers = [/^aktualisiert$/iu];
|
|
3
4
|
//# sourceMappingURL=de.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/** Whole bylines with an explicit timestamp, only ahead of the first editorial line. */
|
|
2
2
|
export default [/^(?:by|written by)\s+[^.!?\n]{2,60}\s+[I|·–—-]\s+(?:[A-Za-z]{3,9}\s+\d{1,2},?\s+\d{4}|\d{4}-\d{2}-\d{2})\s*[-–|·]\s*\d{1,2}:\d{2}(?:\s*[ap]m)?$/iu];
|
|
3
|
+
export const markers = [/^(?:update|updated)$/iu];
|
|
3
4
|
//# sourceMappingURL=en.js.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import de from "./de.js";
|
|
2
|
-
import en from "./en.js";
|
|
3
|
-
import ja from "./ja.js";
|
|
1
|
+
import de, { markers as deMarkers } from "./de.js";
|
|
2
|
+
import en, { markers as enMarkers } from "./en.js";
|
|
3
|
+
import ja, { markers as jaMarkers } from "./ja.js";
|
|
4
4
|
export const SNIPPET_BYLINES = [...de, ...en, ...ja];
|
|
5
|
+
export const SNIPPET_MARKERS = [...deMarkers, ...enMarkers, ...jaMarkers];
|
|
5
6
|
/** File names and copyright notices are metadata only when they stand alone before the text. */
|
|
7
|
+
export const SNIPPET_IMAGE_FILENAME = /^[\p{L}\p{N}_. -]{3,120}\.(?:jpe?g|png|webp|gif|avif)$/iu;
|
|
8
|
+
export const SNIPPET_IMAGE_CREDIT = /^(?:©|\(c\)|copyright(?:\s*©)?)\s*[^!?\n]{1,100}$/iu;
|
|
6
9
|
export const SNIPPET_IMAGE_METADATA = [
|
|
7
|
-
|
|
10
|
+
SNIPPET_IMAGE_FILENAME,
|
|
8
11
|
/^(?:©|\(c\)|copyright(?:\s*©)?)\s*[^.!?\n]{1,100}$/iu,
|
|
9
12
|
];
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/** Whole bylines with an explicit timestamp, only ahead of the first editorial line. */
|
|
2
2
|
export default [/^(?:著者|執筆|文)[::]\s*[^。!?\n]{1,40}\s+[I|·–—-]\s*\d{4}年\d{1,2}月\d{1,2}日\s*[-–|·]\s*\d{1,2}:\d{2}$/u];
|
|
3
|
+
export const markers = [/^(?:更新|更新済み)$/u];
|
|
3
4
|
//# sourceMappingURL=ja.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cleanVideoPage } from "./content/noise/videoPages.js";
|
|
2
2
|
import { lazyImages } from "./content/noise/lazyImages.js";
|
|
3
3
|
import { JSDOM } from "jsdom";
|
|
4
|
-
import { SNIPPET_BYLINES, SNIPPET_IMAGE_METADATA } from "./content/patterns/snippet-metadata/index.js";
|
|
4
|
+
import { SNIPPET_BYLINES, SNIPPET_IMAGE_CREDIT, SNIPPET_IMAGE_FILENAME, SNIPPET_IMAGE_METADATA, SNIPPET_MARKERS } from "./content/patterns/snippet-metadata/index.js";
|
|
5
5
|
import { BOILERPLATE_NEWSLETTER, BOILERPLATE_ORPHAN_HEADINGS } from "./content/patterns/boilerplate/index.js";
|
|
6
6
|
import { CONSENT_ANCHORS, CONSENT_COMPANIONS } from "./content/patterns/consent/index.js";
|
|
7
7
|
import { SIDEBAR_HEADINGS } from "./content/patterns/sidebars/index.js";
|
|
@@ -1026,13 +1026,25 @@ export function cleanSnippet(snippet, title) {
|
|
|
1026
1026
|
text = text.replace(pattern, "");
|
|
1027
1027
|
const headline = normalized(title ?? "");
|
|
1028
1028
|
let inMetadata = true;
|
|
1029
|
+
let afterImageFilename = false;
|
|
1029
1030
|
text = text.split("\n").filter(line => {
|
|
1030
1031
|
const value = line.trim();
|
|
1031
1032
|
if (!value)
|
|
1032
1033
|
return false;
|
|
1034
|
+
if (inMetadata && SNIPPET_IMAGE_FILENAME.test(value)) {
|
|
1035
|
+
afterImageFilename = true;
|
|
1036
|
+
return false;
|
|
1037
|
+
}
|
|
1038
|
+
if (inMetadata && afterImageFilename && SNIPPET_IMAGE_CREDIT.test(value)) {
|
|
1039
|
+
afterImageFilename = false;
|
|
1040
|
+
return false;
|
|
1041
|
+
}
|
|
1042
|
+
afterImageFilename = false;
|
|
1033
1043
|
if (inMetadata && (matchesAny(value, SNIPPET_BYLINES) || matchesAny(value, SNIPPET_IMAGE_METADATA) ||
|
|
1034
1044
|
(headline && normalized(value) === headline)))
|
|
1035
1045
|
return false;
|
|
1046
|
+
if (inMetadata && matchesAny(value, SNIPPET_MARKERS))
|
|
1047
|
+
return true;
|
|
1036
1048
|
inMetadata = false;
|
|
1037
1049
|
return true;
|
|
1038
1050
|
}).join("\n");
|
|
@@ -1041,7 +1053,7 @@ export function cleanSnippet(snippet, title) {
|
|
|
1041
1053
|
return lines.join("\n").trim();
|
|
1042
1054
|
}
|
|
1043
1055
|
/** Raised whenever the rules above change what they remove, so stored leads are derived again. */
|
|
1044
|
-
export const LEAD_VERSION =
|
|
1056
|
+
export const LEAD_VERSION = 5;
|
|
1045
1057
|
const LEAD_LENGTH = 600;
|
|
1046
1058
|
function shorten(text, max) {
|
|
1047
1059
|
if (text.length <= max)
|