feedscout 1.8.1 → 2.0.0-beta.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/README.md +1 -1
- package/dist/common/discover/utils.d.ts +2 -3
- package/dist/common/locales.js +214 -10
- package/dist/common/types.d.ts +2 -1
- package/dist/common/uris/feed/types.d.ts +2 -2
- package/dist/common/uris/html/types.d.ts +4 -4
- package/dist/common/utils.d.ts +6 -4
- package/dist/common/utils.js +12 -3
- package/dist/feeds/defaults.d.ts +2 -1
- package/dist/feeds/defaults.js +116 -9
- package/dist/feeds/extractors.js +2 -2
- package/dist/feeds/platform/handlers/acast.js +26 -0
- package/dist/feeds/platform/handlers/ameblo.js +36 -0
- package/dist/feeds/platform/handlers/applePodcasts.js +1 -1
- package/dist/feeds/platform/handlers/arena.js +42 -0
- package/dist/feeds/platform/handlers/artstation.js +52 -0
- package/dist/feeds/platform/handlers/audioboom.js +23 -0
- package/dist/feeds/platform/handlers/bearblog.js +45 -0
- package/dist/feeds/platform/handlers/behance.js +7 -0
- package/dist/feeds/platform/handlers/blogspot.js +38 -2
- package/dist/feeds/platform/handlers/bookwyrm.js +48 -0
- package/dist/feeds/platform/handlers/buttondown.js +43 -0
- package/dist/feeds/platform/handlers/buzzsprout.js +22 -0
- package/dist/feeds/platform/handlers/codeberg.js +5 -5
- package/dist/feeds/platform/handlers/dailymotion.js +16 -0
- package/dist/feeds/platform/handlers/deviantart.js +25 -6
- package/dist/feeds/platform/handlers/devto.js +8 -0
- package/dist/feeds/platform/handlers/discourse.js +70 -0
- package/dist/feeds/platform/handlers/dreamwidth.js +48 -0
- package/dist/feeds/platform/handlers/exblog.js +35 -0
- package/dist/feeds/platform/handlers/fireside.js +24 -0
- package/dist/feeds/platform/handlers/friendica.js +44 -0
- package/dist/feeds/platform/handlers/ghost.js +30 -0
- package/dist/feeds/platform/handlers/github.js +6 -0
- package/dist/feeds/platform/handlers/githubGist.js +16 -5
- package/dist/feeds/platform/handlers/gitlab.js +31 -13
- package/dist/feeds/platform/handlers/goodreads.js +18 -8
- package/dist/feeds/platform/handlers/hackernews.js +21 -0
- package/dist/feeds/platform/handlers/hashnode.js +1 -1
- package/dist/feeds/platform/handlers/hatenablog.js +4 -1
- package/dist/feeds/platform/handlers/hearthis.js +32 -0
- package/dist/feeds/platform/handlers/heyWorld.js +18 -0
- package/dist/feeds/platform/handlers/insanejournal.js +69 -0
- package/dist/feeds/platform/handlers/itchio.js +24 -1
- package/dist/feeds/platform/handlers/lemmy.js +46 -4
- package/dist/feeds/platform/handlers/letterboxd.js +4 -0
- package/dist/feeds/platform/handlers/libsyn.js +25 -0
- package/dist/feeds/platform/handlers/listed.js +20 -0
- package/dist/feeds/platform/handlers/livejournal.js +68 -0
- package/dist/feeds/platform/handlers/mastodon.js +32 -0
- package/dist/feeds/platform/handlers/mataroa.js +16 -0
- package/dist/feeds/platform/handlers/medium.js +2 -2
- package/dist/feeds/platform/handlers/microblog.js +55 -0
- package/dist/feeds/platform/handlers/misskey.js +40 -0
- package/dist/feeds/platform/handlers/myanimelist.js +43 -0
- package/dist/feeds/platform/handlers/naverBlog.js +21 -0
- package/dist/feeds/platform/handlers/nebula.js +68 -0
- package/dist/feeds/platform/handlers/note.js +53 -0
- package/dist/feeds/platform/handlers/observable.js +34 -0
- package/dist/feeds/platform/handlers/odysee.js +20 -0
- package/dist/feeds/platform/handlers/pagecord.js +16 -0
- package/dist/feeds/platform/handlers/paragraph.js +1 -2
- package/dist/feeds/platform/handlers/pika.js +35 -0
- package/dist/feeds/platform/handlers/pinterest.js +13 -0
- package/dist/feeds/platform/handlers/pixelfed.js +46 -0
- package/dist/feeds/platform/handlers/pleroma.js +34 -0
- package/dist/feeds/platform/handlers/podbean.js +29 -0
- package/dist/feeds/platform/handlers/podigee.js +29 -0
- package/dist/feeds/platform/handlers/posthaven.js +24 -0
- package/dist/feeds/platform/handlers/prose.js +26 -0
- package/dist/feeds/platform/handlers/qiita.js +58 -0
- package/dist/feeds/platform/handlers/reddit.js +83 -9
- package/dist/feeds/platform/handlers/rssCom.js +20 -0
- package/dist/feeds/platform/handlers/seesaa.js +22 -0
- package/dist/feeds/platform/handlers/sourceforge.js +37 -4
- package/dist/feeds/platform/handlers/spreaker.js +21 -0
- package/dist/feeds/platform/handlers/stackExchange.js +26 -2
- package/dist/feeds/platform/handlers/steam.js +7 -0
- package/dist/feeds/platform/handlers/tildes.js +41 -0
- package/dist/feeds/platform/handlers/tistory.js +16 -0
- package/dist/feeds/platform/handlers/transistor.js +29 -0
- package/dist/feeds/platform/handlers/velog.js +24 -0
- package/dist/feeds/platform/handlers/vimeo.js +6 -0
- package/dist/feeds/platform/handlers/weblogLol.js +26 -0
- package/dist/feeds/platform/handlers/weebly.js +25 -0
- package/dist/feeds/platform/handlers/wordpress.js +173 -28
- package/dist/feeds/platform/handlers/writeas.js +51 -0
- package/dist/feeds/platform/handlers/ximalaya.js +1 -1
- package/dist/feeds/platform/handlers/youtube.js +4 -1
- package/dist/feeds/platform/handlers/zenn.js +54 -0
- package/dist/feeds.d.ts +2 -2
- package/dist/feeds.js +2 -2
- package/dist/utils.d.ts +2 -1
- package/package.json +24 -64
- package/dist/blogrolls/defaults.cjs +0 -51
- package/dist/blogrolls/defaults.d.cts +0 -17
- package/dist/blogrolls/extractors.cjs +0 -21
- package/dist/blogrolls/extractors.d.cts +0 -7
- package/dist/blogrolls/index.cjs +0 -25
- package/dist/blogrolls/index.d.cts +0 -7
- package/dist/blogrolls/types.d.cts +0 -6
- package/dist/blogrolls.cjs +0 -13
- package/dist/blogrolls.d.cts +0 -4
- package/dist/common/discover/defaults.cjs +0 -46
- package/dist/common/discover/defaults.d.cts +0 -6
- package/dist/common/discover/index.cjs +0 -105
- package/dist/common/discover/utils.cjs +0 -101
- package/dist/common/discover/utils.d.cts +0 -6
- package/dist/common/locales.cjs +0 -144
- package/dist/common/types.cjs +0 -10
- package/dist/common/types.d.cts +0 -89
- package/dist/common/uris/feed/index.cjs +0 -12
- package/dist/common/uris/feed/index.d.cts +0 -6
- package/dist/common/uris/feed/types.d.cts +0 -9
- package/dist/common/uris/guess/index.cjs +0 -8
- package/dist/common/uris/guess/index.d.cts +0 -7
- package/dist/common/uris/guess/types.d.cts +0 -10
- package/dist/common/uris/guess/utils.cjs +0 -42
- package/dist/common/uris/guess/utils.d.cts +0 -8
- package/dist/common/uris/headers/index.cjs +0 -26
- package/dist/common/uris/headers/index.d.cts +0 -6
- package/dist/common/uris/headers/types.d.cts +0 -9
- package/dist/common/uris/html/handlers.cjs +0 -45
- package/dist/common/uris/html/index.cjs +0 -19
- package/dist/common/uris/html/index.d.cts +0 -6
- package/dist/common/uris/html/types.d.cts +0 -12
- package/dist/common/uris/index.cjs +0 -32
- package/dist/common/uris/platform/index.cjs +0 -10
- package/dist/common/uris/platform/index.d.cts +0 -7
- package/dist/common/uris/platform/types.d.cts +0 -13
- package/dist/common/utils.cjs +0 -89
- package/dist/common/utils.d.cts +0 -10
- package/dist/favicons/defaults.cjs +0 -65
- package/dist/favicons/defaults.d.cts +0 -18
- package/dist/favicons/extractors.cjs +0 -25
- package/dist/favicons/extractors.d.cts +0 -7
- package/dist/favicons/index.cjs +0 -29
- package/dist/favicons/index.d.cts +0 -7
- package/dist/favicons/platform/handlers/bluesky.cjs +0 -27
- package/dist/favicons/platform/handlers/codeberg.cjs +0 -19
- package/dist/favicons/platform/handlers/deviantart.cjs +0 -29
- package/dist/favicons/platform/handlers/devto.cjs +0 -31
- package/dist/favicons/platform/handlers/github.cjs +0 -19
- package/dist/favicons/platform/handlers/githubGist.cjs +0 -19
- package/dist/favicons/platform/handlers/gitlab.cjs +0 -38
- package/dist/favicons/platform/handlers/lobsters.cjs +0 -21
- package/dist/favicons/platform/handlers/mastodon.cjs +0 -40
- package/dist/favicons/platform/handlers/reddit.cjs +0 -42
- package/dist/favicons/platform/handlers/sourceforge.cjs +0 -21
- package/dist/favicons/platform/handlers/tumblr.cjs +0 -16
- package/dist/favicons/types.d.cts +0 -4
- package/dist/favicons/utils.cjs +0 -10
- package/dist/favicons.cjs +0 -12
- package/dist/favicons.d.cts +0 -4
- package/dist/feeds/defaults.cjs +0 -178
- package/dist/feeds/defaults.d.cts +0 -20
- package/dist/feeds/extractors.cjs +0 -46
- package/dist/feeds/extractors.d.cts +0 -7
- package/dist/feeds/index.cjs +0 -26
- package/dist/feeds/index.d.cts +0 -7
- package/dist/feeds/platform/handlers/applePodcasts.cjs +0 -26
- package/dist/feeds/platform/handlers/behance.cjs +0 -49
- package/dist/feeds/platform/handlers/blogspot.cjs +0 -36
- package/dist/feeds/platform/handlers/bluesky.cjs +0 -20
- package/dist/feeds/platform/handlers/codeberg.cjs +0 -69
- package/dist/feeds/platform/handlers/csdn.cjs +0 -20
- package/dist/feeds/platform/handlers/dailymotion.cjs +0 -70
- package/dist/feeds/platform/handlers/deviantart.cjs +0 -66
- package/dist/feeds/platform/handlers/devto.cjs +0 -50
- package/dist/feeds/platform/handlers/douban.cjs +0 -56
- package/dist/feeds/platform/handlers/github.cjs +0 -116
- package/dist/feeds/platform/handlers/githubGist.cjs +0 -45
- package/dist/feeds/platform/handlers/gitlab.cjs +0 -80
- package/dist/feeds/platform/handlers/goodreads.cjs +0 -39
- package/dist/feeds/platform/handlers/hashnode.cjs +0 -16
- package/dist/feeds/platform/handlers/hatenablog.cjs +0 -53
- package/dist/feeds/platform/handlers/itchio.cjs +0 -88
- package/dist/feeds/platform/handlers/kickstarter.cjs +0 -22
- package/dist/feeds/platform/handlers/lemmy.cjs +0 -46
- package/dist/feeds/platform/handlers/letterboxd.cjs +0 -42
- package/dist/feeds/platform/handlers/lobsters.cjs +0 -57
- package/dist/feeds/platform/handlers/mastodon.cjs +0 -42
- package/dist/feeds/platform/handlers/medium.cjs +0 -68
- package/dist/feeds/platform/handlers/paragraph.cjs +0 -21
- package/dist/feeds/platform/handlers/pinterest.cjs +0 -44
- package/dist/feeds/platform/handlers/producthunt.cjs +0 -29
- package/dist/feeds/platform/handlers/reddit.cjs +0 -75
- package/dist/feeds/platform/handlers/soundcloud.cjs +0 -39
- package/dist/feeds/platform/handlers/sourceforge.cjs +0 -20
- package/dist/feeds/platform/handlers/stackExchange.cjs +0 -40
- package/dist/feeds/platform/handlers/steam.cjs +0 -28
- package/dist/feeds/platform/handlers/substack.cjs +0 -23
- package/dist/feeds/platform/handlers/tumblr.cjs +0 -24
- package/dist/feeds/platform/handlers/v2ex.cjs +0 -35
- package/dist/feeds/platform/handlers/vimeo.cjs +0 -69
- package/dist/feeds/platform/handlers/wordpress.cjs +0 -64
- package/dist/feeds/platform/handlers/wpengine.cjs +0 -10
- package/dist/feeds/platform/handlers/ximalaya.cjs +0 -20
- package/dist/feeds/platform/handlers/youtube.cjs +0 -94
- package/dist/feeds/types.d.cts +0 -9
- package/dist/feeds.cjs +0 -15
- package/dist/feeds.d.cts +0 -4
- package/dist/hubs/discover/index.cjs +0 -30
- package/dist/hubs/discover/index.d.cts +0 -7
- package/dist/hubs/discover/types.d.cts +0 -15
- package/dist/hubs/feed/index.cjs +0 -32
- package/dist/hubs/headers/index.cjs +0 -17
- package/dist/hubs/html/index.cjs +0 -28
- package/dist/hubs.cjs +0 -0
- package/dist/hubs.d.cts +0 -2
- package/dist/index.cjs +0 -13
- package/dist/index.d.cts +0 -8
- package/dist/methods.cjs +0 -15
- package/dist/methods.d.cts +0 -7
- package/dist/utils.cjs +0 -9
- package/dist/utils.d.cts +0 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/weblogLol.ts
|
|
3
|
+
const weblogLolHandler = {
|
|
4
|
+
match: (url) => {
|
|
5
|
+
return isSubdomainOf(url, "weblog.lol");
|
|
6
|
+
},
|
|
7
|
+
resolve: (url) => {
|
|
8
|
+
const { origin } = new URL(url);
|
|
9
|
+
const uris = [];
|
|
10
|
+
uris.push({
|
|
11
|
+
uri: `${origin}/rss.xml`,
|
|
12
|
+
hint: composeHint("weblog-lol:posts-rss")
|
|
13
|
+
});
|
|
14
|
+
uris.push({
|
|
15
|
+
uri: `${origin}/atom.xml`,
|
|
16
|
+
hint: composeHint("weblog-lol:posts-atom")
|
|
17
|
+
});
|
|
18
|
+
uris.push({
|
|
19
|
+
uri: `${origin}/feed.json`,
|
|
20
|
+
hint: composeHint("weblog-lol:posts-json")
|
|
21
|
+
});
|
|
22
|
+
return uris;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { weblogLolHandler };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/weebly.ts
|
|
3
|
+
const numericRegex = /^\d+$/;
|
|
4
|
+
const weeblyHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isSubdomainOf(url, "weebly.com");
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { origin, pathname } = new URL(url);
|
|
10
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
11
|
+
const uris = [];
|
|
12
|
+
const firstSegment = pathSegments[0];
|
|
13
|
+
if (firstSegment && !numericRegex.test(firstSegment)) uris.push({
|
|
14
|
+
uri: `${origin}/${firstSegment}/feed`,
|
|
15
|
+
hint: composeHint("weebly:blog")
|
|
16
|
+
});
|
|
17
|
+
uris.push({
|
|
18
|
+
uri: `${origin}/blog/feed`,
|
|
19
|
+
hint: composeHint("weebly:blog")
|
|
20
|
+
});
|
|
21
|
+
return uris;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { weeblyHandler };
|
|
@@ -3,6 +3,10 @@ import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
|
3
3
|
const categoryRegex = /^\/category\/([^/]+)/;
|
|
4
4
|
const tagRegex = /^\/tag\/([^/]+)/;
|
|
5
5
|
const authorRegex = /^\/author\/([^/]+)/;
|
|
6
|
+
const yearRegex = /^\/(\d{4})\/?$/;
|
|
7
|
+
const yearMonthRegex = /^\/(\d{4})\/(\d{2})\/?$/;
|
|
8
|
+
const dayRegex = /^\/(\d{4})\/(\d{2})\/(\d{2})\/?$/;
|
|
9
|
+
const trailingSlashRegex = /\/$/;
|
|
6
10
|
const wordpressHandler = {
|
|
7
11
|
match: (url) => {
|
|
8
12
|
return isSubdomainOf(url, "wordpress.com");
|
|
@@ -10,53 +14,194 @@ const wordpressHandler = {
|
|
|
10
14
|
resolve: (url) => {
|
|
11
15
|
const { origin, pathname } = new URL(url);
|
|
12
16
|
const uris = [];
|
|
17
|
+
let archiveMatched = false;
|
|
13
18
|
const categoryMatch = pathname.match(categoryRegex);
|
|
14
|
-
if (categoryMatch?.[1])
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
if (categoryMatch?.[1]) {
|
|
20
|
+
archiveMatched = true;
|
|
21
|
+
const base = `${origin}/category/${categoryMatch[1]}`;
|
|
22
|
+
uris.push({
|
|
23
|
+
uri: [
|
|
24
|
+
`${base}/feed/`,
|
|
25
|
+
`${base}/?feed=rss`,
|
|
26
|
+
`${base}/feed/rss2/`,
|
|
27
|
+
`${base}/?feed=rss2`
|
|
28
|
+
],
|
|
29
|
+
hint: composeHint("wordpress:category-rss")
|
|
30
|
+
});
|
|
31
|
+
uris.push({
|
|
32
|
+
uri: [`${base}/feed/atom/`, `${base}/?feed=atom`],
|
|
33
|
+
hint: composeHint("wordpress:category-atom")
|
|
34
|
+
});
|
|
35
|
+
uris.push({
|
|
36
|
+
uri: [`${base}/feed/rdf/`, `${base}/?feed=rdf`],
|
|
37
|
+
hint: composeHint("wordpress:category-rdf")
|
|
38
|
+
});
|
|
39
|
+
}
|
|
18
40
|
const tagMatch = pathname.match(tagRegex);
|
|
19
|
-
if (tagMatch?.[1])
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
41
|
+
if (tagMatch?.[1]) {
|
|
42
|
+
archiveMatched = true;
|
|
43
|
+
const base = `${origin}/tag/${tagMatch[1]}`;
|
|
44
|
+
uris.push({
|
|
45
|
+
uri: [
|
|
46
|
+
`${base}/feed/`,
|
|
47
|
+
`${base}/?feed=rss`,
|
|
48
|
+
`${base}/feed/rss2/`,
|
|
49
|
+
`${base}/?feed=rss2`
|
|
50
|
+
],
|
|
51
|
+
hint: composeHint("wordpress:tag-rss")
|
|
52
|
+
});
|
|
53
|
+
uris.push({
|
|
54
|
+
uri: [`${base}/feed/atom/`, `${base}/?feed=atom`],
|
|
55
|
+
hint: composeHint("wordpress:tag-atom")
|
|
56
|
+
});
|
|
57
|
+
uris.push({
|
|
58
|
+
uri: [`${base}/feed/rdf/`, `${base}/?feed=rdf`],
|
|
59
|
+
hint: composeHint("wordpress:tag-rdf")
|
|
60
|
+
});
|
|
61
|
+
}
|
|
23
62
|
const authorMatch = pathname.match(authorRegex);
|
|
24
|
-
if (authorMatch?.[1])
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
63
|
+
if (authorMatch?.[1]) {
|
|
64
|
+
archiveMatched = true;
|
|
65
|
+
const base = `${origin}/author/${authorMatch[1]}`;
|
|
66
|
+
uris.push({
|
|
67
|
+
uri: [
|
|
68
|
+
`${base}/feed/`,
|
|
69
|
+
`${base}/?feed=rss`,
|
|
70
|
+
`${base}/feed/rss2/`,
|
|
71
|
+
`${base}/?feed=rss2`
|
|
72
|
+
],
|
|
73
|
+
hint: composeHint("wordpress:author-rss")
|
|
74
|
+
});
|
|
75
|
+
uris.push({
|
|
76
|
+
uri: [`${base}/feed/atom/`, `${base}/?feed=atom`],
|
|
77
|
+
hint: composeHint("wordpress:author-atom")
|
|
78
|
+
});
|
|
79
|
+
uris.push({
|
|
80
|
+
uri: [`${base}/feed/rdf/`, `${base}/?feed=rdf`],
|
|
81
|
+
hint: composeHint("wordpress:author-rdf")
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const dayMatch = pathname.match(dayRegex);
|
|
85
|
+
if (dayMatch?.[1] && dayMatch?.[2] && dayMatch?.[3]) {
|
|
86
|
+
archiveMatched = true;
|
|
87
|
+
const base = `${origin}/${dayMatch[1]}/${dayMatch[2]}/${dayMatch[3]}`;
|
|
88
|
+
uris.push({
|
|
89
|
+
uri: [
|
|
90
|
+
`${base}/feed/`,
|
|
91
|
+
`${base}/?feed=rss`,
|
|
92
|
+
`${base}/feed/rss2/`,
|
|
93
|
+
`${base}/?feed=rss2`
|
|
94
|
+
],
|
|
95
|
+
hint: composeHint("wordpress:date-archive-rss")
|
|
96
|
+
});
|
|
97
|
+
uris.push({
|
|
98
|
+
uri: [`${base}/feed/atom/`, `${base}/?feed=atom`],
|
|
99
|
+
hint: composeHint("wordpress:date-archive-atom")
|
|
100
|
+
});
|
|
101
|
+
uris.push({
|
|
102
|
+
uri: [`${base}/feed/rdf/`, `${base}/?feed=rdf`],
|
|
103
|
+
hint: composeHint("wordpress:date-archive-rdf")
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const yearMonthMatch = pathname.match(yearMonthRegex);
|
|
107
|
+
if (yearMonthMatch?.[1] && yearMonthMatch?.[2]) {
|
|
108
|
+
archiveMatched = true;
|
|
109
|
+
const base = `${origin}/${yearMonthMatch[1]}/${yearMonthMatch[2]}`;
|
|
110
|
+
uris.push({
|
|
111
|
+
uri: [
|
|
112
|
+
`${base}/feed/`,
|
|
113
|
+
`${base}/?feed=rss`,
|
|
114
|
+
`${base}/feed/rss2/`,
|
|
115
|
+
`${base}/?feed=rss2`
|
|
116
|
+
],
|
|
117
|
+
hint: composeHint("wordpress:date-archive-rss")
|
|
118
|
+
});
|
|
119
|
+
uris.push({
|
|
120
|
+
uri: [`${base}/feed/atom/`, `${base}/?feed=atom`],
|
|
121
|
+
hint: composeHint("wordpress:date-archive-atom")
|
|
122
|
+
});
|
|
123
|
+
uris.push({
|
|
124
|
+
uri: [`${base}/feed/rdf/`, `${base}/?feed=rdf`],
|
|
125
|
+
hint: composeHint("wordpress:date-archive-rdf")
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const yearMatch = pathname.match(yearRegex);
|
|
129
|
+
if (yearMatch?.[1]) {
|
|
130
|
+
archiveMatched = true;
|
|
131
|
+
const base = `${origin}/${yearMatch[1]}`;
|
|
132
|
+
uris.push({
|
|
133
|
+
uri: [
|
|
134
|
+
`${base}/feed/`,
|
|
135
|
+
`${base}/?feed=rss`,
|
|
136
|
+
`${base}/feed/rss2/`,
|
|
137
|
+
`${base}/?feed=rss2`
|
|
138
|
+
],
|
|
139
|
+
hint: composeHint("wordpress:date-archive-rss")
|
|
140
|
+
});
|
|
141
|
+
uris.push({
|
|
142
|
+
uri: [`${base}/feed/atom/`, `${base}/?feed=atom`],
|
|
143
|
+
hint: composeHint("wordpress:date-archive-atom")
|
|
144
|
+
});
|
|
145
|
+
uris.push({
|
|
146
|
+
uri: [`${base}/feed/rdf/`, `${base}/?feed=rdf`],
|
|
147
|
+
hint: composeHint("wordpress:date-archive-rdf")
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
151
|
+
if (!archiveMatched && segments.length > 0 && !segments.includes("feed")) {
|
|
152
|
+
const base = `${origin}${pathname.replace(trailingSlashRegex, "")}`;
|
|
153
|
+
uris.push({
|
|
154
|
+
uri: [
|
|
155
|
+
`${base}/feed/`,
|
|
156
|
+
`${base}/?feed=rss`,
|
|
157
|
+
`${base}/feed/rss2/`,
|
|
158
|
+
`${base}/?feed=rss2`
|
|
159
|
+
],
|
|
160
|
+
hint: composeHint("wordpress:post-comments-rss")
|
|
161
|
+
});
|
|
162
|
+
uris.push({
|
|
163
|
+
uri: [`${base}/feed/atom/`, `${base}/?feed=atom`],
|
|
164
|
+
hint: composeHint("wordpress:post-comments-atom")
|
|
165
|
+
});
|
|
166
|
+
uris.push({
|
|
167
|
+
uri: [`${base}/feed/rdf/`, `${base}/?feed=rdf`],
|
|
168
|
+
hint: composeHint("wordpress:post-comments-rdf")
|
|
169
|
+
});
|
|
170
|
+
}
|
|
28
171
|
uris.push({
|
|
29
|
-
uri: [
|
|
30
|
-
|
|
172
|
+
uri: [
|
|
173
|
+
`${origin}/feed/`,
|
|
174
|
+
`${origin}/?feed=rss`,
|
|
175
|
+
`${origin}/feed/rss2/`,
|
|
176
|
+
`${origin}/?feed=rss2`
|
|
177
|
+
],
|
|
178
|
+
hint: composeHint("wordpress:posts-rss")
|
|
31
179
|
});
|
|
32
180
|
uris.push({
|
|
33
|
-
uri: [`${origin}/feed/
|
|
34
|
-
hint: composeHint("wordpress:posts-
|
|
181
|
+
uri: [`${origin}/feed/atom/`, `${origin}/?feed=atom`],
|
|
182
|
+
hint: composeHint("wordpress:posts-atom")
|
|
35
183
|
});
|
|
36
184
|
uris.push({
|
|
37
185
|
uri: [`${origin}/feed/rdf/`, `${origin}/?feed=rdf`],
|
|
38
186
|
hint: composeHint("wordpress:posts-rdf")
|
|
39
187
|
});
|
|
40
188
|
uris.push({
|
|
41
|
-
uri: [
|
|
42
|
-
|
|
189
|
+
uri: [
|
|
190
|
+
`${origin}/comments/feed/`,
|
|
191
|
+
`${origin}/?feed=comments-rss`,
|
|
192
|
+
`${origin}/comments/feed/rss2/`,
|
|
193
|
+
`${origin}/?feed=comments-rss2`
|
|
194
|
+
],
|
|
195
|
+
hint: composeHint("wordpress:comments-rss")
|
|
43
196
|
});
|
|
44
197
|
uris.push({
|
|
45
|
-
uri: [`${origin}/comments/feed/`, `${origin}/?feed=comments-
|
|
46
|
-
hint: composeHint("wordpress:comments")
|
|
47
|
-
});
|
|
48
|
-
uris.push({
|
|
49
|
-
uri: [`${origin}/comments/feed/rss2/`, `${origin}/?feed=comments-rss2`],
|
|
50
|
-
hint: composeHint("wordpress:comments-rss2")
|
|
198
|
+
uri: [`${origin}/comments/feed/atom/`, `${origin}/?feed=comments-atom`],
|
|
199
|
+
hint: composeHint("wordpress:comments-atom")
|
|
51
200
|
});
|
|
52
201
|
uris.push({
|
|
53
202
|
uri: [`${origin}/comments/feed/rdf/`, `${origin}/?feed=comments-rdf`],
|
|
54
203
|
hint: composeHint("wordpress:comments-rdf")
|
|
55
204
|
});
|
|
56
|
-
uris.push({
|
|
57
|
-
uri: [`${origin}/comments/feed/atom/`, `${origin}/?feed=comments-atom`],
|
|
58
|
-
hint: composeHint("wordpress:comments-atom")
|
|
59
|
-
});
|
|
60
205
|
return uris;
|
|
61
206
|
}
|
|
62
207
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/writeas.ts
|
|
3
|
+
const hosts = ["write.as", "www.write.as"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"api",
|
|
7
|
+
"blog",
|
|
8
|
+
"docs",
|
|
9
|
+
"legal",
|
|
10
|
+
"login",
|
|
11
|
+
"me",
|
|
12
|
+
"pricing",
|
|
13
|
+
"privacy",
|
|
14
|
+
"settings",
|
|
15
|
+
"signup",
|
|
16
|
+
"terms"
|
|
17
|
+
];
|
|
18
|
+
const tagRegex = /^\/([^/]+)\/tag:([^/]+)/;
|
|
19
|
+
const writeasHandler = {
|
|
20
|
+
match: (url) => {
|
|
21
|
+
return isHostOf(url, hosts);
|
|
22
|
+
},
|
|
23
|
+
resolve: (url) => {
|
|
24
|
+
const { pathname } = new URL(url);
|
|
25
|
+
const uris = [];
|
|
26
|
+
const tagMatch = pathname.match(tagRegex);
|
|
27
|
+
if (tagMatch?.[1] && tagMatch?.[2]) {
|
|
28
|
+
const username = tagMatch[1];
|
|
29
|
+
const tag = tagMatch[2];
|
|
30
|
+
uris.push({
|
|
31
|
+
uri: `https://write.as/${username}/tag:${tag}/feed/`,
|
|
32
|
+
hint: composeHint("writeas:tag")
|
|
33
|
+
});
|
|
34
|
+
uris.push({
|
|
35
|
+
uri: `https://write.as/${username}/feed/`,
|
|
36
|
+
hint: composeHint("writeas:blog")
|
|
37
|
+
});
|
|
38
|
+
return uris;
|
|
39
|
+
}
|
|
40
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
41
|
+
if (pathSegments.length === 0) return [];
|
|
42
|
+
const username = pathSegments[0];
|
|
43
|
+
if (isAnyOf(username, excludedPaths)) return [];
|
|
44
|
+
return [{
|
|
45
|
+
uri: `https://write.as/${username}/feed/`,
|
|
46
|
+
hint: composeHint("writeas:blog")
|
|
47
|
+
}];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { writeasHandler };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
2
|
//#region src/feeds/platform/handlers/ximalaya.ts
|
|
3
|
-
const albumRegex =
|
|
3
|
+
const albumRegex = /(?:^|\/)album\/(\d+)/;
|
|
4
4
|
const hosts = ["www.ximalaya.com", "ximalaya.com"];
|
|
5
5
|
const ximalayaHandler = {
|
|
6
6
|
match: (url) => {
|
|
@@ -5,11 +5,14 @@ const channelRegex = /^\/channel\/(UC[a-zA-Z0-9_-]+)/;
|
|
|
5
5
|
const handleRegex = /^\/@([^/]+)/;
|
|
6
6
|
const userRegex = /^\/user\/([^/]+)/;
|
|
7
7
|
const customRegex = /^\/c\/([^/]+)/;
|
|
8
|
+
const shortsRegex = /^\/shorts\/[\w-]+/;
|
|
9
|
+
const liveRegex = /^\/live\/[\w-]+/;
|
|
8
10
|
const channelPrefixRegex = /^UC/;
|
|
9
11
|
const hosts = [
|
|
10
12
|
"youtube.com",
|
|
11
13
|
"www.youtube.com",
|
|
12
14
|
"m.youtube.com",
|
|
15
|
+
"music.youtube.com",
|
|
13
16
|
"youtu.be",
|
|
14
17
|
"www.youtu.be"
|
|
15
18
|
];
|
|
@@ -82,7 +85,7 @@ const youtubeHandler = {
|
|
|
82
85
|
hint: composeHint("youtube:playlist")
|
|
83
86
|
});
|
|
84
87
|
if (uris.length === 0 && content) {
|
|
85
|
-
if (parsedUrl.searchParams.has("v") || parsedUrl.hostname.includes("youtu.be") && parsedUrl.pathname.length > 1 || parsedUrl.pathname.match(handleRegex) || parsedUrl.pathname.match(userRegex) || parsedUrl.pathname.match(customRegex)) {
|
|
88
|
+
if (parsedUrl.searchParams.has("v") || parsedUrl.hostname.includes("youtu.be") && parsedUrl.pathname.length > 1 || shortsRegex.test(parsedUrl.pathname) || liveRegex.test(parsedUrl.pathname) || parsedUrl.pathname.match(handleRegex) || parsedUrl.pathname.match(userRegex) || parsedUrl.pathname.match(customRegex)) {
|
|
86
89
|
const channelId = extractChannelIdFromContent(content);
|
|
87
90
|
if (channelId) pushChannelUris(uris, channelId);
|
|
88
91
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/zenn.ts
|
|
3
|
+
const hosts = ["zenn.dev", "www.zenn.dev"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"api",
|
|
7
|
+
"articles",
|
|
8
|
+
"books",
|
|
9
|
+
"login",
|
|
10
|
+
"notifications",
|
|
11
|
+
"p",
|
|
12
|
+
"privacy",
|
|
13
|
+
"publications",
|
|
14
|
+
"scraps",
|
|
15
|
+
"search",
|
|
16
|
+
"settings",
|
|
17
|
+
"signup",
|
|
18
|
+
"terms",
|
|
19
|
+
"topics"
|
|
20
|
+
];
|
|
21
|
+
const topicRegex = /^\/topics\/([^/]+)/;
|
|
22
|
+
const publicationShortRegex = /^\/p\/([^/]+)/;
|
|
23
|
+
const publicationLongRegex = /^\/publications\/([^/]+)/;
|
|
24
|
+
const zennHandler = {
|
|
25
|
+
match: (url) => {
|
|
26
|
+
return isHostOf(url, hosts);
|
|
27
|
+
},
|
|
28
|
+
resolve: (url) => {
|
|
29
|
+
const { pathname } = new URL(url);
|
|
30
|
+
const topicMatch = pathname.match(topicRegex);
|
|
31
|
+
if (topicMatch?.[1]) return [{
|
|
32
|
+
uri: `https://zenn.dev/topics/${topicMatch[1]}/feed`,
|
|
33
|
+
hint: composeHint("zenn:topic")
|
|
34
|
+
}];
|
|
35
|
+
const pubMatch = pathname.match(publicationShortRegex) ?? pathname.match(publicationLongRegex);
|
|
36
|
+
if (pubMatch?.[1]) return [{
|
|
37
|
+
uri: `https://zenn.dev/p/${pubMatch[1]}/feed`,
|
|
38
|
+
hint: composeHint("zenn:publication")
|
|
39
|
+
}];
|
|
40
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
41
|
+
if (pathSegments.length === 0) return [{
|
|
42
|
+
uri: "https://zenn.dev/feed",
|
|
43
|
+
hint: composeHint("zenn:trending")
|
|
44
|
+
}];
|
|
45
|
+
const username = pathSegments[0];
|
|
46
|
+
if (isAnyOf(username, excludedPaths)) return [];
|
|
47
|
+
return [{
|
|
48
|
+
uri: `https://zenn.dev/${username}/feed`,
|
|
49
|
+
hint: composeHint("zenn:posts")
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { zennHandler };
|
package/dist/feeds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
1
|
+
import { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
2
2
|
import { FeedResult } from "./feeds/types.js";
|
|
3
3
|
import { defaultExtractFn } from "./feeds/extractors.js";
|
|
4
|
-
export { FeedResult, anchorLabels, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
4
|
+
export { FeedResult, anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
package/dist/feeds.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
1
|
+
import { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
2
2
|
import { defaultExtractFn } from "./feeds/extractors.js";
|
|
3
|
-
export { anchorLabels, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
3
|
+
export { anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { Pattern } from "./common/types.js";
|
|
1
2
|
import { anyWordMatchesAnyOf, endsWithAnyOf, includesAnyOf, isAnyOf, isHostOf, isSubdomainOf, omitEmpty } from "./common/utils.js";
|
|
2
|
-
export { anyWordMatchesAnyOf, endsWithAnyOf, includesAnyOf, isAnyOf, isHostOf, isSubdomainOf, omitEmpty };
|
|
3
|
+
export { type Pattern, anyWordMatchesAnyOf, endsWithAnyOf, includesAnyOf, isAnyOf, isHostOf, isSubdomainOf, omitEmpty };
|
package/package.json
CHANGED
|
@@ -26,74 +26,32 @@
|
|
|
26
26
|
"type": "module",
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"default": "./dist/index.js"
|
|
32
|
-
},
|
|
33
|
-
"require": {
|
|
34
|
-
"types": "./dist/index.d.cts",
|
|
35
|
-
"default": "./dist/index.cjs"
|
|
36
|
-
}
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.js"
|
|
37
31
|
},
|
|
38
32
|
"./feeds": {
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
"default": "./dist/feeds.js"
|
|
42
|
-
},
|
|
43
|
-
"require": {
|
|
44
|
-
"types": "./dist/feeds.d.cts",
|
|
45
|
-
"default": "./dist/feeds.cjs"
|
|
46
|
-
}
|
|
33
|
+
"types": "./dist/feeds.d.ts",
|
|
34
|
+
"default": "./dist/feeds.js"
|
|
47
35
|
},
|
|
48
36
|
"./blogrolls": {
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"default": "./dist/blogrolls.js"
|
|
52
|
-
},
|
|
53
|
-
"require": {
|
|
54
|
-
"types": "./dist/blogrolls.d.cts",
|
|
55
|
-
"default": "./dist/blogrolls.cjs"
|
|
56
|
-
}
|
|
37
|
+
"types": "./dist/blogrolls.d.ts",
|
|
38
|
+
"default": "./dist/blogrolls.js"
|
|
57
39
|
},
|
|
58
40
|
"./favicons": {
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
"default": "./dist/favicons.js"
|
|
62
|
-
},
|
|
63
|
-
"require": {
|
|
64
|
-
"types": "./dist/favicons.d.cts",
|
|
65
|
-
"default": "./dist/favicons.cjs"
|
|
66
|
-
}
|
|
41
|
+
"types": "./dist/favicons.d.ts",
|
|
42
|
+
"default": "./dist/favicons.js"
|
|
67
43
|
},
|
|
68
44
|
"./hubs": {
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
"default": "./dist/hubs.js"
|
|
72
|
-
},
|
|
73
|
-
"require": {
|
|
74
|
-
"types": "./dist/hubs.d.cts",
|
|
75
|
-
"default": "./dist/hubs.cjs"
|
|
76
|
-
}
|
|
45
|
+
"types": "./dist/hubs.d.ts",
|
|
46
|
+
"default": "./dist/hubs.js"
|
|
77
47
|
},
|
|
78
48
|
"./methods": {
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
"default": "./dist/methods.js"
|
|
82
|
-
},
|
|
83
|
-
"require": {
|
|
84
|
-
"types": "./dist/methods.d.cts",
|
|
85
|
-
"default": "./dist/methods.cjs"
|
|
86
|
-
}
|
|
49
|
+
"types": "./dist/methods.d.ts",
|
|
50
|
+
"default": "./dist/methods.js"
|
|
87
51
|
},
|
|
88
52
|
"./utils": {
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
"default": "./dist/utils.js"
|
|
92
|
-
},
|
|
93
|
-
"require": {
|
|
94
|
-
"types": "./dist/utils.d.cts",
|
|
95
|
-
"default": "./dist/utils.cjs"
|
|
96
|
-
}
|
|
53
|
+
"types": "./dist/utils.d.ts",
|
|
54
|
+
"default": "./dist/utils.js"
|
|
97
55
|
},
|
|
98
56
|
"./package.json": "./package.json"
|
|
99
57
|
},
|
|
@@ -102,20 +60,22 @@
|
|
|
102
60
|
],
|
|
103
61
|
"scripts": {
|
|
104
62
|
"prepare": "lefthook install",
|
|
105
|
-
"build": "tsdown src/exports/index.ts src/exports/feeds.ts src/exports/blogrolls.ts src/exports/favicons.ts src/exports/hubs.ts src/exports/methods.ts src/exports/utils.ts --format
|
|
63
|
+
"build": "tsdown src/exports/index.ts src/exports/feeds.ts src/exports/blogrolls.ts src/exports/favicons.ts src/exports/hubs.ts src/exports/methods.ts src/exports/utils.ts --format esm --dts --clean --unbundle --no-fixed-extension",
|
|
106
64
|
"docs:dev": "vitepress dev docs",
|
|
107
65
|
"docs:build": "vitepress build docs"
|
|
108
66
|
},
|
|
109
67
|
"dependencies": {
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
68
|
+
"htmlparser2": "^12.0.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"feedsmith": "^3.0.0-beta.4"
|
|
113
72
|
},
|
|
114
73
|
"devDependencies": {
|
|
115
|
-
"@types/bun": "^1.3.
|
|
116
|
-
"
|
|
117
|
-
"
|
|
74
|
+
"@types/bun": "^1.3.13",
|
|
75
|
+
"feedsmith": "^3.0.0-beta.4",
|
|
76
|
+
"kvalita": "^1.13.0",
|
|
77
|
+
"tsdown": "^0.22.2",
|
|
118
78
|
"vitepress": "^2.0.0-alpha.17"
|
|
119
79
|
},
|
|
120
|
-
"version": "
|
|
80
|
+
"version": "2.0.0-beta.1"
|
|
121
81
|
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//#region src/blogrolls/defaults.ts
|
|
2
|
-
const mimeTypes = [
|
|
3
|
-
"text/x-opml",
|
|
4
|
-
"application/xml",
|
|
5
|
-
"text/xml"
|
|
6
|
-
];
|
|
7
|
-
const urisMinimal = [
|
|
8
|
-
"/.well-known/recommendations.opml",
|
|
9
|
-
"/blogroll.opml",
|
|
10
|
-
"/opml.xml"
|
|
11
|
-
];
|
|
12
|
-
const urisBalanced = [
|
|
13
|
-
...urisMinimal,
|
|
14
|
-
"/blogroll.xml",
|
|
15
|
-
"/subscriptions.opml",
|
|
16
|
-
"/recommendations.opml"
|
|
17
|
-
];
|
|
18
|
-
const urisComprehensive = [
|
|
19
|
-
...urisBalanced,
|
|
20
|
-
"/links.opml",
|
|
21
|
-
"/feeds.opml",
|
|
22
|
-
"/subscriptions.xml"
|
|
23
|
-
];
|
|
24
|
-
const anchorLabels = [
|
|
25
|
-
"blogroll",
|
|
26
|
-
"opml",
|
|
27
|
-
"subscriptions",
|
|
28
|
-
"reading list"
|
|
29
|
-
];
|
|
30
|
-
const linkSelectors = [{ rel: "blogroll" }, {
|
|
31
|
-
rel: "outline",
|
|
32
|
-
types: mimeTypes
|
|
33
|
-
}];
|
|
34
|
-
const defaultHtmlOptions = {
|
|
35
|
-
linkSelectors,
|
|
36
|
-
anchorUris: urisComprehensive,
|
|
37
|
-
anchorIgnoredUris: [],
|
|
38
|
-
anchorLabels
|
|
39
|
-
};
|
|
40
|
-
const defaultHeadersOptions = { linkSelectors };
|
|
41
|
-
const defaultGuessOptions = { uris: urisBalanced };
|
|
42
|
-
//#endregion
|
|
43
|
-
exports.anchorLabels = anchorLabels;
|
|
44
|
-
exports.defaultGuessOptions = defaultGuessOptions;
|
|
45
|
-
exports.defaultHeadersOptions = defaultHeadersOptions;
|
|
46
|
-
exports.defaultHtmlOptions = defaultHtmlOptions;
|
|
47
|
-
exports.linkSelectors = linkSelectors;
|
|
48
|
-
exports.mimeTypes = mimeTypes;
|
|
49
|
-
exports.urisBalanced = urisBalanced;
|
|
50
|
-
exports.urisComprehensive = urisComprehensive;
|
|
51
|
-
exports.urisMinimal = urisMinimal;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GuessMethodOptions } from "../common/uris/guess/types.cjs";
|
|
2
|
-
import { HeadersMethodOptions } from "../common/uris/headers/types.cjs";
|
|
3
|
-
import { HtmlMethodOptions } from "../common/uris/html/types.cjs";
|
|
4
|
-
import { LinkSelector } from "../common/types.cjs";
|
|
5
|
-
|
|
6
|
-
//#region src/blogrolls/defaults.d.ts
|
|
7
|
-
declare const mimeTypes: string[];
|
|
8
|
-
declare const urisMinimal: string[];
|
|
9
|
-
declare const urisBalanced: string[];
|
|
10
|
-
declare const urisComprehensive: string[];
|
|
11
|
-
declare const anchorLabels: string[];
|
|
12
|
-
declare const linkSelectors: Array<LinkSelector>;
|
|
13
|
-
declare const defaultHtmlOptions: Omit<HtmlMethodOptions, 'baseUrl'>;
|
|
14
|
-
declare const defaultHeadersOptions: Omit<HeadersMethodOptions, 'baseUrl'>;
|
|
15
|
-
declare const defaultGuessOptions: Omit<GuessMethodOptions, 'baseUrl'>;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
let feedsmith = require("feedsmith");
|
|
2
|
-
//#region src/blogrolls/extractors.ts
|
|
3
|
-
const defaultExtractFn = ({ content, url }) => {
|
|
4
|
-
if (!content) return {
|
|
5
|
-
url,
|
|
6
|
-
isValid: false
|
|
7
|
-
};
|
|
8
|
-
try {
|
|
9
|
-
return {
|
|
10
|
-
url,
|
|
11
|
-
isValid: true,
|
|
12
|
-
title: (0, feedsmith.parseOpml)(content).head?.title
|
|
13
|
-
};
|
|
14
|
-
} catch {}
|
|
15
|
-
return {
|
|
16
|
-
url,
|
|
17
|
-
isValid: false
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
exports.defaultExtractFn = defaultExtractFn;
|