feedscout 1.8.0 → 1.9.0
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/blogrolls/defaults.cjs +16 -10
- package/dist/blogrolls/defaults.d.cts +1 -2
- package/dist/blogrolls/defaults.d.ts +1 -2
- package/dist/blogrolls/defaults.js +17 -10
- package/dist/blogrolls/extractors.cjs +2 -2
- package/dist/blogrolls/extractors.d.cts +2 -2
- package/dist/blogrolls/extractors.d.ts +2 -2
- package/dist/blogrolls/extractors.js +2 -2
- package/dist/blogrolls/index.cjs +9 -10
- package/dist/blogrolls/index.js +4 -5
- package/dist/blogrolls.cjs +1 -2
- package/dist/blogrolls.d.cts +3 -3
- package/dist/blogrolls.d.ts +3 -3
- package/dist/blogrolls.js +3 -3
- package/dist/common/discover/defaults.cjs +46 -0
- package/dist/common/discover/defaults.d.cts +6 -0
- package/dist/common/discover/defaults.d.ts +6 -0
- package/dist/common/discover/defaults.js +44 -0
- package/dist/common/discover/index.cjs +7 -7
- package/dist/common/discover/index.js +2 -2
- package/dist/common/discover/utils.cjs +0 -29
- package/dist/common/discover/utils.d.cts +1 -3
- package/dist/common/discover/utils.d.ts +1 -3
- package/dist/common/discover/utils.js +1 -28
- package/dist/common/locales.cjs +214 -10
- package/dist/common/locales.js +214 -10
- package/dist/common/types.d.cts +3 -2
- package/dist/common/types.d.ts +3 -2
- package/dist/common/uris/html/handlers.cjs +14 -0
- package/dist/common/uris/html/handlers.js +14 -0
- package/dist/common/uris/html/index.cjs +17 -1
- package/dist/common/uris/html/index.js +17 -1
- package/dist/common/uris/html/types.d.cts +5 -4
- package/dist/common/uris/html/types.d.ts +5 -4
- package/dist/common/utils.cjs +12 -11
- package/dist/common/utils.d.cts +6 -4
- package/dist/common/utils.d.ts +6 -4
- package/dist/common/utils.js +13 -11
- package/dist/favicons/extractors.cjs +2 -2
- package/dist/favicons/extractors.d.cts +2 -2
- package/dist/favicons/extractors.d.ts +2 -2
- package/dist/favicons/extractors.js +2 -2
- package/dist/favicons/index.cjs +11 -12
- package/dist/favicons/index.js +4 -5
- package/dist/favicons.cjs +1 -1
- package/dist/favicons.d.cts +2 -2
- package/dist/favicons.d.ts +2 -2
- package/dist/favicons.js +2 -2
- package/dist/feeds/defaults.cjs +121 -9
- package/dist/feeds/defaults.d.cts +4 -3
- package/dist/feeds/defaults.d.ts +4 -3
- package/dist/feeds/defaults.js +121 -10
- package/dist/feeds/extractors.cjs +6 -6
- package/dist/feeds/extractors.d.cts +2 -2
- package/dist/feeds/extractors.d.ts +2 -2
- package/dist/feeds/extractors.js +4 -4
- package/dist/feeds/index.cjs +9 -10
- package/dist/feeds/index.js +4 -5
- package/dist/feeds/platform/handlers/acast.cjs +26 -0
- package/dist/feeds/platform/handlers/acast.js +26 -0
- package/dist/feeds/platform/handlers/ameblo.cjs +36 -0
- package/dist/feeds/platform/handlers/ameblo.js +36 -0
- package/dist/feeds/platform/handlers/applePodcasts.cjs +1 -1
- package/dist/feeds/platform/handlers/applePodcasts.js +1 -1
- package/dist/feeds/platform/handlers/arena.cjs +42 -0
- package/dist/feeds/platform/handlers/arena.js +42 -0
- package/dist/feeds/platform/handlers/artstation.cjs +52 -0
- package/dist/feeds/platform/handlers/artstation.js +52 -0
- package/dist/feeds/platform/handlers/audioboom.cjs +23 -0
- package/dist/feeds/platform/handlers/audioboom.js +23 -0
- package/dist/feeds/platform/handlers/bearblog.cjs +45 -0
- package/dist/feeds/platform/handlers/bearblog.js +45 -0
- package/dist/feeds/platform/handlers/behance.cjs +7 -0
- package/dist/feeds/platform/handlers/behance.js +7 -0
- package/dist/feeds/platform/handlers/blogspot.cjs +38 -2
- package/dist/feeds/platform/handlers/blogspot.js +38 -2
- package/dist/feeds/platform/handlers/bookwyrm.cjs +48 -0
- package/dist/feeds/platform/handlers/bookwyrm.js +48 -0
- package/dist/feeds/platform/handlers/buttondown.cjs +43 -0
- package/dist/feeds/platform/handlers/buttondown.js +43 -0
- package/dist/feeds/platform/handlers/buzzsprout.cjs +22 -0
- package/dist/feeds/platform/handlers/buzzsprout.js +22 -0
- package/dist/feeds/platform/handlers/codeberg.cjs +5 -5
- package/dist/feeds/platform/handlers/codeberg.js +5 -5
- package/dist/feeds/platform/handlers/dailymotion.cjs +16 -0
- package/dist/feeds/platform/handlers/dailymotion.js +16 -0
- package/dist/feeds/platform/handlers/deviantart.cjs +25 -6
- package/dist/feeds/platform/handlers/deviantart.js +25 -6
- package/dist/feeds/platform/handlers/devto.cjs +8 -0
- package/dist/feeds/platform/handlers/devto.js +8 -0
- package/dist/feeds/platform/handlers/discourse.cjs +70 -0
- package/dist/feeds/platform/handlers/discourse.js +70 -0
- package/dist/feeds/platform/handlers/dreamwidth.cjs +48 -0
- package/dist/feeds/platform/handlers/dreamwidth.js +48 -0
- package/dist/feeds/platform/handlers/exblog.cjs +35 -0
- package/dist/feeds/platform/handlers/exblog.js +35 -0
- package/dist/feeds/platform/handlers/fireside.cjs +24 -0
- package/dist/feeds/platform/handlers/fireside.js +24 -0
- package/dist/feeds/platform/handlers/friendica.cjs +44 -0
- package/dist/feeds/platform/handlers/friendica.js +44 -0
- package/dist/feeds/platform/handlers/ghost.cjs +30 -0
- package/dist/feeds/platform/handlers/ghost.js +30 -0
- package/dist/feeds/platform/handlers/github.cjs +6 -0
- package/dist/feeds/platform/handlers/github.js +6 -0
- package/dist/feeds/platform/handlers/githubGist.cjs +16 -5
- package/dist/feeds/platform/handlers/githubGist.js +16 -5
- package/dist/feeds/platform/handlers/gitlab.cjs +31 -13
- package/dist/feeds/platform/handlers/gitlab.js +31 -13
- package/dist/feeds/platform/handlers/goodreads.cjs +18 -8
- package/dist/feeds/platform/handlers/goodreads.js +18 -8
- package/dist/feeds/platform/handlers/hackernews.cjs +21 -0
- package/dist/feeds/platform/handlers/hackernews.js +21 -0
- package/dist/feeds/platform/handlers/hashnode.cjs +1 -1
- package/dist/feeds/platform/handlers/hashnode.js +1 -1
- package/dist/feeds/platform/handlers/hatenablog.cjs +4 -1
- package/dist/feeds/platform/handlers/hatenablog.js +4 -1
- package/dist/feeds/platform/handlers/hearthis.cjs +32 -0
- package/dist/feeds/platform/handlers/hearthis.js +32 -0
- package/dist/feeds/platform/handlers/heyWorld.cjs +18 -0
- package/dist/feeds/platform/handlers/heyWorld.js +18 -0
- package/dist/feeds/platform/handlers/insanejournal.cjs +69 -0
- package/dist/feeds/platform/handlers/insanejournal.js +69 -0
- package/dist/feeds/platform/handlers/itchio.cjs +24 -1
- package/dist/feeds/platform/handlers/itchio.js +24 -1
- package/dist/feeds/platform/handlers/lemmy.cjs +46 -4
- package/dist/feeds/platform/handlers/lemmy.js +46 -4
- package/dist/feeds/platform/handlers/letterboxd.cjs +4 -0
- package/dist/feeds/platform/handlers/letterboxd.js +4 -0
- package/dist/feeds/platform/handlers/libsyn.cjs +25 -0
- package/dist/feeds/platform/handlers/libsyn.js +25 -0
- package/dist/feeds/platform/handlers/listed.cjs +20 -0
- package/dist/feeds/platform/handlers/listed.js +20 -0
- package/dist/feeds/platform/handlers/livejournal.cjs +68 -0
- package/dist/feeds/platform/handlers/livejournal.js +68 -0
- package/dist/feeds/platform/handlers/mastodon.cjs +32 -0
- package/dist/feeds/platform/handlers/mastodon.js +32 -0
- package/dist/feeds/platform/handlers/mataroa.cjs +16 -0
- package/dist/feeds/platform/handlers/mataroa.js +16 -0
- package/dist/feeds/platform/handlers/medium.cjs +2 -2
- package/dist/feeds/platform/handlers/medium.js +2 -2
- package/dist/feeds/platform/handlers/microblog.cjs +55 -0
- package/dist/feeds/platform/handlers/microblog.js +55 -0
- package/dist/feeds/platform/handlers/misskey.cjs +40 -0
- package/dist/feeds/platform/handlers/misskey.js +40 -0
- package/dist/feeds/platform/handlers/myanimelist.cjs +43 -0
- package/dist/feeds/platform/handlers/myanimelist.js +43 -0
- package/dist/feeds/platform/handlers/naverBlog.cjs +21 -0
- package/dist/feeds/platform/handlers/naverBlog.js +21 -0
- package/dist/feeds/platform/handlers/nebula.cjs +68 -0
- package/dist/feeds/platform/handlers/nebula.js +68 -0
- package/dist/feeds/platform/handlers/note.cjs +53 -0
- package/dist/feeds/platform/handlers/note.js +53 -0
- package/dist/feeds/platform/handlers/observable.cjs +34 -0
- package/dist/feeds/platform/handlers/observable.js +34 -0
- package/dist/feeds/platform/handlers/odysee.cjs +20 -0
- package/dist/feeds/platform/handlers/odysee.js +20 -0
- package/dist/feeds/platform/handlers/pagecord.cjs +16 -0
- package/dist/feeds/platform/handlers/pagecord.js +16 -0
- package/dist/feeds/platform/handlers/paragraph.cjs +1 -2
- package/dist/feeds/platform/handlers/paragraph.js +1 -2
- package/dist/feeds/platform/handlers/pika.cjs +35 -0
- package/dist/feeds/platform/handlers/pika.js +35 -0
- package/dist/feeds/platform/handlers/pinterest.cjs +13 -0
- package/dist/feeds/platform/handlers/pinterest.js +13 -0
- package/dist/feeds/platform/handlers/pixelfed.cjs +46 -0
- package/dist/feeds/platform/handlers/pixelfed.js +46 -0
- package/dist/feeds/platform/handlers/pleroma.cjs +34 -0
- package/dist/feeds/platform/handlers/pleroma.js +34 -0
- package/dist/feeds/platform/handlers/podbean.cjs +29 -0
- package/dist/feeds/platform/handlers/podbean.js +29 -0
- package/dist/feeds/platform/handlers/podigee.cjs +29 -0
- package/dist/feeds/platform/handlers/podigee.js +29 -0
- package/dist/feeds/platform/handlers/posthaven.cjs +24 -0
- package/dist/feeds/platform/handlers/posthaven.js +24 -0
- package/dist/feeds/platform/handlers/prose.cjs +26 -0
- package/dist/feeds/platform/handlers/prose.js +26 -0
- package/dist/feeds/platform/handlers/qiita.cjs +58 -0
- package/dist/feeds/platform/handlers/qiita.js +58 -0
- package/dist/feeds/platform/handlers/reddit.cjs +83 -9
- package/dist/feeds/platform/handlers/reddit.js +83 -9
- package/dist/feeds/platform/handlers/rssCom.cjs +20 -0
- package/dist/feeds/platform/handlers/rssCom.js +20 -0
- package/dist/feeds/platform/handlers/seesaa.cjs +22 -0
- package/dist/feeds/platform/handlers/seesaa.js +22 -0
- package/dist/feeds/platform/handlers/sourceforge.cjs +37 -4
- package/dist/feeds/platform/handlers/sourceforge.js +37 -4
- package/dist/feeds/platform/handlers/spreaker.cjs +21 -0
- package/dist/feeds/platform/handlers/spreaker.js +21 -0
- package/dist/feeds/platform/handlers/stackExchange.cjs +26 -2
- package/dist/feeds/platform/handlers/stackExchange.js +26 -2
- package/dist/feeds/platform/handlers/steam.cjs +7 -0
- package/dist/feeds/platform/handlers/steam.js +7 -0
- package/dist/feeds/platform/handlers/tildes.cjs +41 -0
- package/dist/feeds/platform/handlers/tildes.js +41 -0
- package/dist/feeds/platform/handlers/tistory.cjs +16 -0
- package/dist/feeds/platform/handlers/tistory.js +16 -0
- package/dist/feeds/platform/handlers/transistor.cjs +29 -0
- package/dist/feeds/platform/handlers/transistor.js +29 -0
- package/dist/feeds/platform/handlers/velog.cjs +24 -0
- package/dist/feeds/platform/handlers/velog.js +24 -0
- package/dist/feeds/platform/handlers/vimeo.cjs +6 -0
- package/dist/feeds/platform/handlers/vimeo.js +6 -0
- package/dist/feeds/platform/handlers/weblogLol.cjs +26 -0
- package/dist/feeds/platform/handlers/weblogLol.js +26 -0
- package/dist/feeds/platform/handlers/weebly.cjs +25 -0
- package/dist/feeds/platform/handlers/weebly.js +25 -0
- package/dist/feeds/platform/handlers/wordpress.cjs +173 -28
- package/dist/feeds/platform/handlers/wordpress.js +173 -28
- package/dist/feeds/platform/handlers/writeas.cjs +51 -0
- package/dist/feeds/platform/handlers/writeas.js +51 -0
- package/dist/feeds/platform/handlers/ximalaya.cjs +1 -1
- package/dist/feeds/platform/handlers/ximalaya.js +1 -1
- package/dist/feeds/platform/handlers/youtube.cjs +4 -1
- package/dist/feeds/platform/handlers/youtube.js +4 -1
- package/dist/feeds/platform/handlers/zenn.cjs +54 -0
- package/dist/feeds/platform/handlers/zenn.js +54 -0
- package/dist/feeds.cjs +2 -1
- package/dist/feeds.d.cts +3 -3
- package/dist/feeds.d.ts +3 -3
- package/dist/feeds.js +3 -3
- package/dist/hubs/discover/index.cjs +4 -4
- package/dist/hubs/discover/index.js +3 -3
- package/dist/hubs/feed/index.cjs +2 -2
- package/dist/hubs/feed/index.js +2 -2
- package/dist/hubs/headers/index.cjs +2 -2
- package/dist/hubs/headers/index.js +2 -2
- package/dist/hubs/html/index.cjs +2 -2
- package/dist/hubs/html/index.js +2 -2
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/utils.d.cts +2 -1
- package/dist/utils.d.ts +2 -1
- package/package.json +6 -7
|
@@ -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: require_utils.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
|
}
|
|
@@ -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
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
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 require_utils.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: require_utils.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: require_utils.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: require_utils.composeHint("zenn:trending")
|
|
44
|
+
}];
|
|
45
|
+
const username = pathSegments[0];
|
|
46
|
+
if (require_utils.isAnyOf(username, excludedPaths)) return [];
|
|
47
|
+
return [{
|
|
48
|
+
uri: `https://zenn.dev/${username}/feed`,
|
|
49
|
+
hint: require_utils.composeHint("zenn:posts")
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.zennHandler = zennHandler;
|
|
@@ -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.cjs
CHANGED
|
@@ -2,7 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_defaults = require("./feeds/defaults.cjs");
|
|
3
3
|
const require_extractors = require("./feeds/extractors.cjs");
|
|
4
4
|
exports.anchorLabels = require_defaults.anchorLabels;
|
|
5
|
-
exports.
|
|
5
|
+
exports.anchorPathSegments = require_defaults.anchorPathSegments;
|
|
6
|
+
exports.defaultExtractFn = require_extractors.defaultExtractFn;
|
|
6
7
|
exports.defaultGuessOptions = require_defaults.defaultGuessOptions;
|
|
7
8
|
exports.defaultHeadersOptions = require_defaults.defaultHeadersOptions;
|
|
8
9
|
exports.defaultHtmlOptions = require_defaults.defaultHtmlOptions;
|
package/dist/feeds.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.cjs";
|
|
1
|
+
import { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.cjs";
|
|
2
2
|
import { FeedResult } from "./feeds/types.cjs";
|
|
3
|
-
import {
|
|
4
|
-
export { FeedResult, anchorLabels,
|
|
3
|
+
import { defaultExtractFn } from "./feeds/extractors.cjs";
|
|
4
|
+
export { FeedResult, anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
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
|
-
import {
|
|
4
|
-
export { FeedResult, anchorLabels,
|
|
3
|
+
import { defaultExtractFn } from "./feeds/extractors.js";
|
|
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";
|
|
2
|
-
import {
|
|
3
|
-
export { anchorLabels,
|
|
1
|
+
import { anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.js";
|
|
2
|
+
import { defaultExtractFn } from "./feeds/extractors.js";
|
|
3
|
+
export { anchorLabels, anchorPathSegments, defaultExtractFn, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_utils = require("../../common/utils.cjs");
|
|
2
|
-
const
|
|
1
|
+
const require_utils = require("../../common/discover/utils.cjs");
|
|
2
|
+
const require_defaults = require("../../common/discover/defaults.cjs");
|
|
3
3
|
const require_index = require("../feed/index.cjs");
|
|
4
4
|
const require_index$1 = require("../headers/index.cjs");
|
|
5
5
|
const require_index$2 = require("../html/index.cjs");
|
|
@@ -9,8 +9,8 @@ const discoverHubs = async (input, options = {}) => {
|
|
|
9
9
|
"headers",
|
|
10
10
|
"feed",
|
|
11
11
|
"html"
|
|
12
|
-
], fetchFn =
|
|
13
|
-
const normalizedInput = await require_utils
|
|
12
|
+
], fetchFn = require_defaults.defaultFetchFn, resolveUrlFn = require_defaults.defaultResolveUrlFn } = options;
|
|
13
|
+
const normalizedInput = await require_utils.normalizeInput(input, fetchFn);
|
|
14
14
|
const results = [];
|
|
15
15
|
if (methods.includes("headers") && normalizedInput.headers) {
|
|
16
16
|
const headerHubs = require_index$1.discoverHubsFromHeaders(normalizedInput.headers, normalizedInput.url, resolveUrlFn);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defaultFetchFn,
|
|
1
|
+
import { normalizeInput } from "../../common/discover/utils.js";
|
|
2
|
+
import { defaultFetchFn, defaultResolveUrlFn } from "../../common/discover/defaults.js";
|
|
3
3
|
import { discoverHubsFromFeed } from "../feed/index.js";
|
|
4
4
|
import { discoverHubsFromHeaders } from "../headers/index.js";
|
|
5
5
|
import { discoverHubsFromHtml } from "../html/index.js";
|
|
@@ -9,7 +9,7 @@ const discoverHubs = async (input, options = {}) => {
|
|
|
9
9
|
"headers",
|
|
10
10
|
"feed",
|
|
11
11
|
"html"
|
|
12
|
-
], fetchFn = defaultFetchFn, resolveUrlFn =
|
|
12
|
+
], fetchFn = defaultFetchFn, resolveUrlFn = defaultResolveUrlFn } = options;
|
|
13
13
|
const normalizedInput = await normalizeInput(input, fetchFn);
|
|
14
14
|
const results = [];
|
|
15
15
|
if (methods.includes("headers") && normalizedInput.headers) {
|
package/dist/hubs/feed/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_defaults = require("../../common/discover/defaults.cjs");
|
|
2
2
|
let feedsmith = require("feedsmith");
|
|
3
3
|
//#region src/hubs/feed/index.ts
|
|
4
4
|
const getLinksWithRel = (links, rel) => {
|
|
5
5
|
return links?.filter((link) => link.rel === rel && link.href).map((link) => link.href) ?? [];
|
|
6
6
|
};
|
|
7
|
-
const discoverHubsFromFeed = (content, baseUrl, resolveUrlFn =
|
|
7
|
+
const discoverHubsFromFeed = (content, baseUrl, resolveUrlFn = require_defaults.defaultResolveUrlFn) => {
|
|
8
8
|
try {
|
|
9
9
|
const { format, feed } = (0, feedsmith.parseFeed)(content);
|
|
10
10
|
if (format === "json") {
|
package/dist/hubs/feed/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaultResolveUrlFn } from "../../common/discover/defaults.js";
|
|
2
2
|
import { parseFeed } from "feedsmith";
|
|
3
3
|
//#region src/hubs/feed/index.ts
|
|
4
4
|
const getLinksWithRel = (links, rel) => {
|
|
5
5
|
return links?.filter((link) => link.rel === rel && link.href).map((link) => link.href) ?? [];
|
|
6
6
|
};
|
|
7
|
-
const discoverHubsFromFeed = (content, baseUrl, resolveUrlFn =
|
|
7
|
+
const discoverHubsFromFeed = (content, baseUrl, resolveUrlFn = defaultResolveUrlFn) => {
|
|
8
8
|
try {
|
|
9
9
|
const { format, feed } = parseFeed(content);
|
|
10
10
|
if (format === "json") {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_defaults = require("../../common/discover/defaults.cjs");
|
|
2
2
|
const require_index = require("../../common/uris/headers/index.cjs");
|
|
3
3
|
//#region src/hubs/headers/index.ts
|
|
4
4
|
const hubSelector = [{ rel: "hub" }];
|
|
5
5
|
const selfSelector = [{ rel: "self" }];
|
|
6
|
-
const discoverHubsFromHeaders = (headers, baseUrl, resolveUrlFn =
|
|
6
|
+
const discoverHubsFromHeaders = (headers, baseUrl, resolveUrlFn = require_defaults.defaultResolveUrlFn) => {
|
|
7
7
|
const hubUris = require_index.discoverUrisFromHeaders(headers, { linkSelectors: hubSelector });
|
|
8
8
|
if (hubUris.length === 0) return [];
|
|
9
9
|
const selfUris = require_index.discoverUrisFromHeaders(headers, { linkSelectors: selfSelector });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaultResolveUrlFn } from "../../common/discover/defaults.js";
|
|
2
2
|
import { discoverUrisFromHeaders } from "../../common/uris/headers/index.js";
|
|
3
3
|
//#region src/hubs/headers/index.ts
|
|
4
4
|
const hubSelector = [{ rel: "hub" }];
|
|
5
5
|
const selfSelector = [{ rel: "self" }];
|
|
6
|
-
const discoverHubsFromHeaders = (headers, baseUrl, resolveUrlFn =
|
|
6
|
+
const discoverHubsFromHeaders = (headers, baseUrl, resolveUrlFn = defaultResolveUrlFn) => {
|
|
7
7
|
const hubUris = discoverUrisFromHeaders(headers, { linkSelectors: hubSelector });
|
|
8
8
|
if (hubUris.length === 0) return [];
|
|
9
9
|
const selfUris = discoverUrisFromHeaders(headers, { linkSelectors: selfSelector });
|
package/dist/hubs/html/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_defaults = require("../../common/discover/defaults.cjs");
|
|
2
2
|
const require_index = require("../../common/uris/html/index.cjs");
|
|
3
3
|
//#region src/hubs/html/index.ts
|
|
4
4
|
const hubSelector = [{ rel: "hub" }];
|
|
@@ -8,7 +8,7 @@ const htmlOptions = {
|
|
|
8
8
|
anchorIgnoredUris: [],
|
|
9
9
|
anchorLabels: []
|
|
10
10
|
};
|
|
11
|
-
const discoverHubsFromHtml = (content, baseUrl, resolveUrlFn =
|
|
11
|
+
const discoverHubsFromHtml = (content, baseUrl, resolveUrlFn = require_defaults.defaultResolveUrlFn) => {
|
|
12
12
|
const hubUris = require_index.discoverUrisFromHtml(content, {
|
|
13
13
|
...htmlOptions,
|
|
14
14
|
linkSelectors: hubSelector
|
package/dist/hubs/html/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaultResolveUrlFn } from "../../common/discover/defaults.js";
|
|
2
2
|
import { discoverUrisFromHtml } from "../../common/uris/html/index.js";
|
|
3
3
|
//#region src/hubs/html/index.ts
|
|
4
4
|
const hubSelector = [{ rel: "hub" }];
|
|
@@ -8,7 +8,7 @@ const htmlOptions = {
|
|
|
8
8
|
anchorIgnoredUris: [],
|
|
9
9
|
anchorLabels: []
|
|
10
10
|
};
|
|
11
|
-
const discoverHubsFromHtml = (content, baseUrl, resolveUrlFn =
|
|
11
|
+
const discoverHubsFromHtml = (content, baseUrl, resolveUrlFn = defaultResolveUrlFn) => {
|
|
12
12
|
const hubUris = discoverUrisFromHtml(content, {
|
|
13
13
|
...htmlOptions,
|
|
14
14
|
linkSelectors: hubSelector
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils = require("./common/discover/utils.cjs");
|
|
3
|
+
const require_defaults = require("./common/discover/defaults.cjs");
|
|
3
4
|
const require_index = require("./blogrolls/index.cjs");
|
|
4
5
|
const require_index$1 = require("./favicons/index.cjs");
|
|
5
6
|
const require_index$2 = require("./feeds/index.cjs");
|
|
6
7
|
const require_index$3 = require("./hubs/discover/index.cjs");
|
|
7
|
-
exports.defaultResolveSiteUrlFn =
|
|
8
|
+
exports.defaultResolveSiteUrlFn = require_defaults.defaultResolveSiteUrlFn;
|
|
8
9
|
exports.discoverBlogrolls = require_index.discoverBlogrolls;
|
|
9
10
|
exports.discoverFavicons = require_index$1.discoverFavicons;
|
|
10
11
|
exports.discoverFeeds = require_index$2.discoverFeeds;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethod, DiscoverMethodsConfig, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResolveSiteUrlFn, DiscoverResolveUrlFn, DiscoverResult, DiscoverUriEntry, DiscoverUriHint, UriEntry } from "./common/types.cjs";
|
|
2
2
|
import { discoverBlogrolls } from "./blogrolls/index.cjs";
|
|
3
|
-
import { defaultResolveSiteUrlFn
|
|
3
|
+
import { defaultResolveSiteUrlFn } from "./common/discover/defaults.cjs";
|
|
4
|
+
import { getFeedSiteUrl } from "./common/discover/utils.cjs";
|
|
4
5
|
import { discoverFavicons } from "./favicons/index.cjs";
|
|
5
6
|
import { discoverFeeds } from "./feeds/index.cjs";
|
|
6
7
|
import { discoverHubs } from "./hubs/discover/index.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethod, DiscoverMethodsConfig, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResolveSiteUrlFn, DiscoverResolveUrlFn, DiscoverResult, DiscoverUriEntry, DiscoverUriHint, UriEntry } from "./common/types.js";
|
|
2
2
|
import { discoverBlogrolls } from "./blogrolls/index.js";
|
|
3
|
-
import { defaultResolveSiteUrlFn
|
|
3
|
+
import { defaultResolveSiteUrlFn } from "./common/discover/defaults.js";
|
|
4
|
+
import { getFeedSiteUrl } from "./common/discover/utils.js";
|
|
4
5
|
import { discoverFavicons } from "./favicons/index.js";
|
|
5
6
|
import { discoverFeeds } from "./feeds/index.js";
|
|
6
7
|
import { discoverHubs } from "./hubs/discover/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getFeedSiteUrl } from "./common/discover/utils.js";
|
|
2
|
+
import { defaultResolveSiteUrlFn } from "./common/discover/defaults.js";
|
|
2
3
|
import { discoverBlogrolls } from "./blogrolls/index.js";
|
|
3
4
|
import { discoverFavicons } from "./favicons/index.js";
|
|
4
5
|
import { discoverFeeds } from "./feeds/index.js";
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { Pattern } from "./common/types.cjs";
|
|
1
2
|
import { anyWordMatchesAnyOf, endsWithAnyOf, includesAnyOf, isAnyOf, isHostOf, isSubdomainOf, omitEmpty } from "./common/utils.cjs";
|
|
2
|
-
export { anyWordMatchesAnyOf, endsWithAnyOf, includesAnyOf, isAnyOf, isHostOf, isSubdomainOf, omitEmpty };
|
|
3
|
+
export { type Pattern, anyWordMatchesAnyOf, endsWithAnyOf, includesAnyOf, isAnyOf, isHostOf, isSubdomainOf, omitEmpty };
|
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
|
@@ -107,15 +107,14 @@
|
|
|
107
107
|
"docs:build": "vitepress build docs"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"feedsmith": "^2.9.
|
|
111
|
-
"htmlparser2": "^10.1.0"
|
|
112
|
-
"typescript": "^6.0.2"
|
|
110
|
+
"feedsmith": "^2.9.4",
|
|
111
|
+
"htmlparser2": "^10.1.0"
|
|
113
112
|
},
|
|
114
113
|
"devDependencies": {
|
|
115
|
-
"@types/bun": "^1.3.
|
|
116
|
-
"kvalita": "1.
|
|
117
|
-
"tsdown": "^0.
|
|
114
|
+
"@types/bun": "^1.3.14",
|
|
115
|
+
"kvalita": "1.15.1",
|
|
116
|
+
"tsdown": "^0.22.2",
|
|
118
117
|
"vitepress": "^2.0.0-alpha.17"
|
|
119
118
|
},
|
|
120
|
-
"version": "1.
|
|
119
|
+
"version": "1.9.0"
|
|
121
120
|
}
|