feedscout 1.8.1 → 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.cjs +0 -1
- package/dist/blogrolls.d.cts +2 -2
- package/dist/blogrolls.d.ts +2 -2
- package/dist/blogrolls.js +2 -2
- package/dist/common/locales.cjs +214 -10
- package/dist/common/locales.js +214 -10
- package/dist/common/types.d.cts +2 -1
- package/dist/common/types.d.ts +2 -1
- 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 -3
- package/dist/common/utils.d.cts +6 -4
- package/dist/common/utils.d.ts +6 -4
- package/dist/common/utils.js +12 -3
- 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/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 +1 -0
- package/dist/feeds.d.cts +2 -2
- package/dist/feeds.d.ts +2 -2
- package/dist/feeds.js +2 -2
- package/dist/utils.d.cts +2 -1
- package/dist/utils.d.ts +2 -1
- package/package.json +6 -7
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/arena.ts
|
|
3
|
+
const hosts = ["are.na", "www.are.na"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"api",
|
|
7
|
+
"explore",
|
|
8
|
+
"login",
|
|
9
|
+
"premium",
|
|
10
|
+
"privacy",
|
|
11
|
+
"search",
|
|
12
|
+
"settings",
|
|
13
|
+
"signup",
|
|
14
|
+
"support",
|
|
15
|
+
"terms"
|
|
16
|
+
];
|
|
17
|
+
const arenaHandler = {
|
|
18
|
+
match: (url) => {
|
|
19
|
+
return require_utils.isHostOf(url, hosts);
|
|
20
|
+
},
|
|
21
|
+
resolve: (url) => {
|
|
22
|
+
const { pathname } = new URL(url);
|
|
23
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
24
|
+
if (pathSegments.length === 0) return [];
|
|
25
|
+
if (pathSegments[0] === "editorial") return [{
|
|
26
|
+
uri: "https://www.are.na/editorial/feed/rss",
|
|
27
|
+
hint: require_utils.composeHint("arena:editorial")
|
|
28
|
+
}];
|
|
29
|
+
const username = pathSegments[0];
|
|
30
|
+
if (require_utils.isAnyOf(username, excludedPaths)) return [];
|
|
31
|
+
if (pathSegments[1]) return [{
|
|
32
|
+
uri: `https://www.are.na/${username}/${pathSegments[1]}/feed/rss`,
|
|
33
|
+
hint: require_utils.composeHint("arena:channel")
|
|
34
|
+
}];
|
|
35
|
+
return [{
|
|
36
|
+
uri: `https://www.are.na/${username}/feed/rss`,
|
|
37
|
+
hint: require_utils.composeHint("arena:profile")
|
|
38
|
+
}];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
exports.arenaHandler = arenaHandler;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/arena.ts
|
|
3
|
+
const hosts = ["are.na", "www.are.na"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"api",
|
|
7
|
+
"explore",
|
|
8
|
+
"login",
|
|
9
|
+
"premium",
|
|
10
|
+
"privacy",
|
|
11
|
+
"search",
|
|
12
|
+
"settings",
|
|
13
|
+
"signup",
|
|
14
|
+
"support",
|
|
15
|
+
"terms"
|
|
16
|
+
];
|
|
17
|
+
const arenaHandler = {
|
|
18
|
+
match: (url) => {
|
|
19
|
+
return isHostOf(url, hosts);
|
|
20
|
+
},
|
|
21
|
+
resolve: (url) => {
|
|
22
|
+
const { pathname } = new URL(url);
|
|
23
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
24
|
+
if (pathSegments.length === 0) return [];
|
|
25
|
+
if (pathSegments[0] === "editorial") return [{
|
|
26
|
+
uri: "https://www.are.na/editorial/feed/rss",
|
|
27
|
+
hint: composeHint("arena:editorial")
|
|
28
|
+
}];
|
|
29
|
+
const username = pathSegments[0];
|
|
30
|
+
if (isAnyOf(username, excludedPaths)) return [];
|
|
31
|
+
if (pathSegments[1]) return [{
|
|
32
|
+
uri: `https://www.are.na/${username}/${pathSegments[1]}/feed/rss`,
|
|
33
|
+
hint: composeHint("arena:channel")
|
|
34
|
+
}];
|
|
35
|
+
return [{
|
|
36
|
+
uri: `https://www.are.na/${username}/feed/rss`,
|
|
37
|
+
hint: composeHint("arena:profile")
|
|
38
|
+
}];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { arenaHandler };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/artstation.ts
|
|
3
|
+
const hosts = ["artstation.com", "www.artstation.com"];
|
|
4
|
+
const domainSuffix = /\.artstation\.com$/i;
|
|
5
|
+
const excludedPaths = [
|
|
6
|
+
"blogs",
|
|
7
|
+
"channels",
|
|
8
|
+
"contests",
|
|
9
|
+
"features",
|
|
10
|
+
"jobs",
|
|
11
|
+
"learning",
|
|
12
|
+
"login",
|
|
13
|
+
"marketplace",
|
|
14
|
+
"prints",
|
|
15
|
+
"search",
|
|
16
|
+
"signup",
|
|
17
|
+
"studios",
|
|
18
|
+
"terms"
|
|
19
|
+
];
|
|
20
|
+
const artstationHandler = {
|
|
21
|
+
match: (url) => {
|
|
22
|
+
return require_utils.isHostOf(url, hosts) || require_utils.isSubdomainOf(url, "artstation.com");
|
|
23
|
+
},
|
|
24
|
+
resolve: (url) => {
|
|
25
|
+
const parsed = new URL(url);
|
|
26
|
+
if (!require_utils.isHostOf(url, hosts) && require_utils.isSubdomainOf(url, "artstation.com")) return [{
|
|
27
|
+
uri: `https://www.artstation.com/${parsed.hostname.replace(domainSuffix, "")}.rss`,
|
|
28
|
+
hint: require_utils.composeHint("artstation:portfolio")
|
|
29
|
+
}];
|
|
30
|
+
const pathSegments = parsed.pathname.split("/").filter(Boolean);
|
|
31
|
+
if (pathSegments[0] === "artwork" || pathSegments.length === 0) {
|
|
32
|
+
const uris = [];
|
|
33
|
+
uris.push({
|
|
34
|
+
uri: "https://www.artstation.com/artwork.rss",
|
|
35
|
+
hint: require_utils.composeHint("artstation:artwork")
|
|
36
|
+
});
|
|
37
|
+
uris.push({
|
|
38
|
+
uri: "https://www.artstation.com/artwork.rss?sorting=trending",
|
|
39
|
+
hint: require_utils.composeHint("artstation:artwork-trending")
|
|
40
|
+
});
|
|
41
|
+
return uris;
|
|
42
|
+
}
|
|
43
|
+
const username = pathSegments[0];
|
|
44
|
+
if (require_utils.isAnyOf(username, excludedPaths)) return [];
|
|
45
|
+
return [{
|
|
46
|
+
uri: `https://www.artstation.com/${username}.rss`,
|
|
47
|
+
hint: require_utils.composeHint("artstation:portfolio")
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
exports.artstationHandler = artstationHandler;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/artstation.ts
|
|
3
|
+
const hosts = ["artstation.com", "www.artstation.com"];
|
|
4
|
+
const domainSuffix = /\.artstation\.com$/i;
|
|
5
|
+
const excludedPaths = [
|
|
6
|
+
"blogs",
|
|
7
|
+
"channels",
|
|
8
|
+
"contests",
|
|
9
|
+
"features",
|
|
10
|
+
"jobs",
|
|
11
|
+
"learning",
|
|
12
|
+
"login",
|
|
13
|
+
"marketplace",
|
|
14
|
+
"prints",
|
|
15
|
+
"search",
|
|
16
|
+
"signup",
|
|
17
|
+
"studios",
|
|
18
|
+
"terms"
|
|
19
|
+
];
|
|
20
|
+
const artstationHandler = {
|
|
21
|
+
match: (url) => {
|
|
22
|
+
return isHostOf(url, hosts) || isSubdomainOf(url, "artstation.com");
|
|
23
|
+
},
|
|
24
|
+
resolve: (url) => {
|
|
25
|
+
const parsed = new URL(url);
|
|
26
|
+
if (!isHostOf(url, hosts) && isSubdomainOf(url, "artstation.com")) return [{
|
|
27
|
+
uri: `https://www.artstation.com/${parsed.hostname.replace(domainSuffix, "")}.rss`,
|
|
28
|
+
hint: composeHint("artstation:portfolio")
|
|
29
|
+
}];
|
|
30
|
+
const pathSegments = parsed.pathname.split("/").filter(Boolean);
|
|
31
|
+
if (pathSegments[0] === "artwork" || pathSegments.length === 0) {
|
|
32
|
+
const uris = [];
|
|
33
|
+
uris.push({
|
|
34
|
+
uri: "https://www.artstation.com/artwork.rss",
|
|
35
|
+
hint: composeHint("artstation:artwork")
|
|
36
|
+
});
|
|
37
|
+
uris.push({
|
|
38
|
+
uri: "https://www.artstation.com/artwork.rss?sorting=trending",
|
|
39
|
+
hint: composeHint("artstation:artwork-trending")
|
|
40
|
+
});
|
|
41
|
+
return uris;
|
|
42
|
+
}
|
|
43
|
+
const username = pathSegments[0];
|
|
44
|
+
if (isAnyOf(username, excludedPaths)) return [];
|
|
45
|
+
return [{
|
|
46
|
+
uri: `https://www.artstation.com/${username}.rss`,
|
|
47
|
+
hint: composeHint("artstation:portfolio")
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { artstationHandler };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/audioboom.ts
|
|
3
|
+
const hosts = ["audioboom.com", "www.audioboom.com"];
|
|
4
|
+
const channelRegex = /^\/channels\/(\d+)/;
|
|
5
|
+
const audioboomHandler = {
|
|
6
|
+
match: (url) => {
|
|
7
|
+
return require_utils.isHostOf(url, hosts);
|
|
8
|
+
},
|
|
9
|
+
resolve: (url) => {
|
|
10
|
+
const { pathname } = new URL(url);
|
|
11
|
+
const match = pathname.match(channelRegex);
|
|
12
|
+
if (!match?.[1]) return [];
|
|
13
|
+
const channelId = match[1];
|
|
14
|
+
const uris = [];
|
|
15
|
+
uris.push({
|
|
16
|
+
uri: `https://audioboom.com/channels/${channelId}.rss`,
|
|
17
|
+
hint: require_utils.composeHint("audioboom:podcast")
|
|
18
|
+
});
|
|
19
|
+
return uris;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.audioboomHandler = audioboomHandler;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/audioboom.ts
|
|
3
|
+
const hosts = ["audioboom.com", "www.audioboom.com"];
|
|
4
|
+
const channelRegex = /^\/channels\/(\d+)/;
|
|
5
|
+
const audioboomHandler = {
|
|
6
|
+
match: (url) => {
|
|
7
|
+
return isHostOf(url, hosts);
|
|
8
|
+
},
|
|
9
|
+
resolve: (url) => {
|
|
10
|
+
const { pathname } = new URL(url);
|
|
11
|
+
const match = pathname.match(channelRegex);
|
|
12
|
+
if (!match?.[1]) return [];
|
|
13
|
+
const channelId = match[1];
|
|
14
|
+
const uris = [];
|
|
15
|
+
uris.push({
|
|
16
|
+
uri: `https://audioboom.com/channels/${channelId}.rss`,
|
|
17
|
+
hint: composeHint("audioboom:podcast")
|
|
18
|
+
});
|
|
19
|
+
return uris;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { audioboomHandler };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/bearblog.ts
|
|
3
|
+
const apexHosts = ["bearblog.dev", "www.bearblog.dev"];
|
|
4
|
+
const bearblogHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return require_utils.isSubdomainOf(url, "bearblog.dev") || require_utils.isHostOf(url, apexHosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { origin, searchParams } = new URL(url);
|
|
10
|
+
const uris = [];
|
|
11
|
+
if (require_utils.isHostOf(url, apexHosts)) {
|
|
12
|
+
uris.push({
|
|
13
|
+
uri: "https://bearblog.dev/discover/feed/",
|
|
14
|
+
hint: require_utils.composeHint("bearblog:discover-atom")
|
|
15
|
+
});
|
|
16
|
+
uris.push({
|
|
17
|
+
uri: "https://bearblog.dev/discover/feed/?type=rss",
|
|
18
|
+
hint: require_utils.composeHint("bearblog:discover-rss")
|
|
19
|
+
});
|
|
20
|
+
return uris;
|
|
21
|
+
}
|
|
22
|
+
const tag = searchParams.get("q");
|
|
23
|
+
if (tag) {
|
|
24
|
+
uris.push({
|
|
25
|
+
uri: `${origin}/feed/?q=${encodeURIComponent(tag)}`,
|
|
26
|
+
hint: require_utils.composeHint("bearblog:tag-atom")
|
|
27
|
+
});
|
|
28
|
+
uris.push({
|
|
29
|
+
uri: `${origin}/feed/?type=rss&q=${encodeURIComponent(tag)}`,
|
|
30
|
+
hint: require_utils.composeHint("bearblog:tag-rss")
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
uris.push({
|
|
34
|
+
uri: `${origin}/feed/`,
|
|
35
|
+
hint: require_utils.composeHint("bearblog:posts-atom")
|
|
36
|
+
});
|
|
37
|
+
uris.push({
|
|
38
|
+
uri: `${origin}/feed/?type=rss`,
|
|
39
|
+
hint: require_utils.composeHint("bearblog:posts-rss")
|
|
40
|
+
});
|
|
41
|
+
return uris;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
exports.bearblogHandler = bearblogHandler;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { composeHint, isHostOf, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/bearblog.ts
|
|
3
|
+
const apexHosts = ["bearblog.dev", "www.bearblog.dev"];
|
|
4
|
+
const bearblogHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isSubdomainOf(url, "bearblog.dev") || isHostOf(url, apexHosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { origin, searchParams } = new URL(url);
|
|
10
|
+
const uris = [];
|
|
11
|
+
if (isHostOf(url, apexHosts)) {
|
|
12
|
+
uris.push({
|
|
13
|
+
uri: "https://bearblog.dev/discover/feed/",
|
|
14
|
+
hint: composeHint("bearblog:discover-atom")
|
|
15
|
+
});
|
|
16
|
+
uris.push({
|
|
17
|
+
uri: "https://bearblog.dev/discover/feed/?type=rss",
|
|
18
|
+
hint: composeHint("bearblog:discover-rss")
|
|
19
|
+
});
|
|
20
|
+
return uris;
|
|
21
|
+
}
|
|
22
|
+
const tag = searchParams.get("q");
|
|
23
|
+
if (tag) {
|
|
24
|
+
uris.push({
|
|
25
|
+
uri: `${origin}/feed/?q=${encodeURIComponent(tag)}`,
|
|
26
|
+
hint: composeHint("bearblog:tag-atom")
|
|
27
|
+
});
|
|
28
|
+
uris.push({
|
|
29
|
+
uri: `${origin}/feed/?type=rss&q=${encodeURIComponent(tag)}`,
|
|
30
|
+
hint: composeHint("bearblog:tag-rss")
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
uris.push({
|
|
34
|
+
uri: `${origin}/feed/`,
|
|
35
|
+
hint: composeHint("bearblog:posts-atom")
|
|
36
|
+
});
|
|
37
|
+
uris.push({
|
|
38
|
+
uri: `${origin}/feed/?type=rss`,
|
|
39
|
+
hint: composeHint("bearblog:posts-rss")
|
|
40
|
+
});
|
|
41
|
+
return uris;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { bearblogHandler };
|
|
@@ -27,6 +27,13 @@ const behanceHandler = {
|
|
|
27
27
|
},
|
|
28
28
|
resolve: (url) => {
|
|
29
29
|
const { pathname } = new URL(url);
|
|
30
|
+
if (pathname === "/" || pathname === "" || pathname === "/galleries") return [{
|
|
31
|
+
uri: "https://www.behance.net/feeds/projects",
|
|
32
|
+
hint: require_utils.composeHint("behance:projects")
|
|
33
|
+
}, {
|
|
34
|
+
uri: "https://feeds.feedburner.com/behance/vorr",
|
|
35
|
+
hint: require_utils.composeHint("behance:featured")
|
|
36
|
+
}];
|
|
30
37
|
const userMatch = pathname.match(userRegex);
|
|
31
38
|
if (userMatch?.[1]) {
|
|
32
39
|
const username = userMatch[1];
|
|
@@ -27,6 +27,13 @@ const behanceHandler = {
|
|
|
27
27
|
},
|
|
28
28
|
resolve: (url) => {
|
|
29
29
|
const { pathname } = new URL(url);
|
|
30
|
+
if (pathname === "/" || pathname === "" || pathname === "/galleries") return [{
|
|
31
|
+
uri: "https://www.behance.net/feeds/projects",
|
|
32
|
+
hint: composeHint("behance:projects")
|
|
33
|
+
}, {
|
|
34
|
+
uri: "https://feeds.feedburner.com/behance/vorr",
|
|
35
|
+
hint: composeHint("behance:featured")
|
|
36
|
+
}];
|
|
30
37
|
const userMatch = pathname.match(userRegex);
|
|
31
38
|
if (userMatch?.[1]) {
|
|
32
39
|
const username = userMatch[1];
|
|
@@ -2,6 +2,8 @@ const require_utils = require("../../../common/utils.cjs");
|
|
|
2
2
|
//#region src/feeds/platform/handlers/blogspot.ts
|
|
3
3
|
const blogspotDomainRegex = /^.+\.blogspot\.(?:com|co\.[a-z]{2}|com\.[a-z]{2}|[a-z]{2,3})$/;
|
|
4
4
|
const labelRegex = /^\/search\/label\/([^/]+)/;
|
|
5
|
+
const postRegex = /^\/\d{4}\/\d{2}\/[^/]+\.html$/;
|
|
6
|
+
const postCommentsFeedRegex = /href="[^"]*\/feeds\/(\d+)\/comments\/default/;
|
|
5
7
|
const blogspotHandler = {
|
|
6
8
|
match: (url) => {
|
|
7
9
|
try {
|
|
@@ -10,7 +12,7 @@ const blogspotHandler = {
|
|
|
10
12
|
} catch {}
|
|
11
13
|
return false;
|
|
12
14
|
},
|
|
13
|
-
resolve: (url) => {
|
|
15
|
+
resolve: (url, content) => {
|
|
14
16
|
const { origin, pathname } = new URL(url);
|
|
15
17
|
const uris = [];
|
|
16
18
|
const labelMatch = pathname.match(labelRegex);
|
|
@@ -18,8 +20,26 @@ const blogspotHandler = {
|
|
|
18
20
|
const label = labelMatch[1];
|
|
19
21
|
uris.push({
|
|
20
22
|
uri: `${origin}/feeds/posts/default/-/${label}`,
|
|
21
|
-
hint: require_utils.composeHint("blogspot:label")
|
|
23
|
+
hint: require_utils.composeHint("blogspot:label-atom")
|
|
22
24
|
});
|
|
25
|
+
uris.push({
|
|
26
|
+
uri: `${origin}/feeds/posts/default/-/${label}?alt=rss`,
|
|
27
|
+
hint: require_utils.composeHint("blogspot:label-rss")
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (content && postRegex.test(pathname)) {
|
|
31
|
+
const postIdMatch = content.match(postCommentsFeedRegex);
|
|
32
|
+
if (postIdMatch?.[1]) {
|
|
33
|
+
const postId = postIdMatch[1];
|
|
34
|
+
uris.push({
|
|
35
|
+
uri: `${origin}/feeds/${postId}/comments/default`,
|
|
36
|
+
hint: require_utils.composeHint("blogspot:post-comments-atom")
|
|
37
|
+
});
|
|
38
|
+
uris.push({
|
|
39
|
+
uri: `${origin}/feeds/${postId}/comments/default?alt=rss`,
|
|
40
|
+
hint: require_utils.composeHint("blogspot:post-comments-rss")
|
|
41
|
+
});
|
|
42
|
+
}
|
|
23
43
|
}
|
|
24
44
|
uris.push({
|
|
25
45
|
uri: `${origin}/feeds/posts/default`,
|
|
@@ -29,6 +49,22 @@ const blogspotHandler = {
|
|
|
29
49
|
uri: `${origin}/feeds/posts/default?alt=rss`,
|
|
30
50
|
hint: require_utils.composeHint("blogspot:posts-rss")
|
|
31
51
|
});
|
|
52
|
+
uris.push({
|
|
53
|
+
uri: `${origin}/feeds/posts/summary`,
|
|
54
|
+
hint: require_utils.composeHint("blogspot:posts-summary-atom")
|
|
55
|
+
});
|
|
56
|
+
uris.push({
|
|
57
|
+
uri: `${origin}/feeds/posts/summary?alt=rss`,
|
|
58
|
+
hint: require_utils.composeHint("blogspot:posts-summary-rss")
|
|
59
|
+
});
|
|
60
|
+
uris.push({
|
|
61
|
+
uri: `${origin}/feeds/comments/default`,
|
|
62
|
+
hint: require_utils.composeHint("blogspot:comments-atom")
|
|
63
|
+
});
|
|
64
|
+
uris.push({
|
|
65
|
+
uri: `${origin}/feeds/comments/default?alt=rss`,
|
|
66
|
+
hint: require_utils.composeHint("blogspot:comments-rss")
|
|
67
|
+
});
|
|
32
68
|
return uris;
|
|
33
69
|
}
|
|
34
70
|
};
|
|
@@ -2,6 +2,8 @@ import { composeHint } from "../../../common/utils.js";
|
|
|
2
2
|
//#region src/feeds/platform/handlers/blogspot.ts
|
|
3
3
|
const blogspotDomainRegex = /^.+\.blogspot\.(?:com|co\.[a-z]{2}|com\.[a-z]{2}|[a-z]{2,3})$/;
|
|
4
4
|
const labelRegex = /^\/search\/label\/([^/]+)/;
|
|
5
|
+
const postRegex = /^\/\d{4}\/\d{2}\/[^/]+\.html$/;
|
|
6
|
+
const postCommentsFeedRegex = /href="[^"]*\/feeds\/(\d+)\/comments\/default/;
|
|
5
7
|
const blogspotHandler = {
|
|
6
8
|
match: (url) => {
|
|
7
9
|
try {
|
|
@@ -10,7 +12,7 @@ const blogspotHandler = {
|
|
|
10
12
|
} catch {}
|
|
11
13
|
return false;
|
|
12
14
|
},
|
|
13
|
-
resolve: (url) => {
|
|
15
|
+
resolve: (url, content) => {
|
|
14
16
|
const { origin, pathname } = new URL(url);
|
|
15
17
|
const uris = [];
|
|
16
18
|
const labelMatch = pathname.match(labelRegex);
|
|
@@ -18,8 +20,26 @@ const blogspotHandler = {
|
|
|
18
20
|
const label = labelMatch[1];
|
|
19
21
|
uris.push({
|
|
20
22
|
uri: `${origin}/feeds/posts/default/-/${label}`,
|
|
21
|
-
hint: composeHint("blogspot:label")
|
|
23
|
+
hint: composeHint("blogspot:label-atom")
|
|
22
24
|
});
|
|
25
|
+
uris.push({
|
|
26
|
+
uri: `${origin}/feeds/posts/default/-/${label}?alt=rss`,
|
|
27
|
+
hint: composeHint("blogspot:label-rss")
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (content && postRegex.test(pathname)) {
|
|
31
|
+
const postIdMatch = content.match(postCommentsFeedRegex);
|
|
32
|
+
if (postIdMatch?.[1]) {
|
|
33
|
+
const postId = postIdMatch[1];
|
|
34
|
+
uris.push({
|
|
35
|
+
uri: `${origin}/feeds/${postId}/comments/default`,
|
|
36
|
+
hint: composeHint("blogspot:post-comments-atom")
|
|
37
|
+
});
|
|
38
|
+
uris.push({
|
|
39
|
+
uri: `${origin}/feeds/${postId}/comments/default?alt=rss`,
|
|
40
|
+
hint: composeHint("blogspot:post-comments-rss")
|
|
41
|
+
});
|
|
42
|
+
}
|
|
23
43
|
}
|
|
24
44
|
uris.push({
|
|
25
45
|
uri: `${origin}/feeds/posts/default`,
|
|
@@ -29,6 +49,22 @@ const blogspotHandler = {
|
|
|
29
49
|
uri: `${origin}/feeds/posts/default?alt=rss`,
|
|
30
50
|
hint: composeHint("blogspot:posts-rss")
|
|
31
51
|
});
|
|
52
|
+
uris.push({
|
|
53
|
+
uri: `${origin}/feeds/posts/summary`,
|
|
54
|
+
hint: composeHint("blogspot:posts-summary-atom")
|
|
55
|
+
});
|
|
56
|
+
uris.push({
|
|
57
|
+
uri: `${origin}/feeds/posts/summary?alt=rss`,
|
|
58
|
+
hint: composeHint("blogspot:posts-summary-rss")
|
|
59
|
+
});
|
|
60
|
+
uris.push({
|
|
61
|
+
uri: `${origin}/feeds/comments/default`,
|
|
62
|
+
hint: composeHint("blogspot:comments-atom")
|
|
63
|
+
});
|
|
64
|
+
uris.push({
|
|
65
|
+
uri: `${origin}/feeds/comments/default?alt=rss`,
|
|
66
|
+
hint: composeHint("blogspot:comments-rss")
|
|
67
|
+
});
|
|
32
68
|
return uris;
|
|
33
69
|
}
|
|
34
70
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/bookwyrm.ts
|
|
3
|
+
const profileRegex = /^\/user\/([^/]+)/;
|
|
4
|
+
const shelfRegex = /^\/user\/([^/]+)\/(?:shelf|books)\/([^/]+)\/?/;
|
|
5
|
+
const isBookwyrmHtml = (content) => {
|
|
6
|
+
return require_utils.hasMetaContent(content, "generator", "BookWyrm");
|
|
7
|
+
};
|
|
8
|
+
const bookwyrmHandler = {
|
|
9
|
+
match: (url, content) => {
|
|
10
|
+
try {
|
|
11
|
+
if (!content || !isBookwyrmHtml(content)) return false;
|
|
12
|
+
const { pathname } = new URL(url);
|
|
13
|
+
return profileRegex.test(pathname);
|
|
14
|
+
} catch {}
|
|
15
|
+
return false;
|
|
16
|
+
},
|
|
17
|
+
resolve: (url) => {
|
|
18
|
+
try {
|
|
19
|
+
const { origin, pathname } = new URL(url);
|
|
20
|
+
const match = pathname.match(profileRegex);
|
|
21
|
+
if (!match?.[1]) return [];
|
|
22
|
+
const user = match[1];
|
|
23
|
+
const uris = [];
|
|
24
|
+
const shelfMatch = pathname.match(shelfRegex);
|
|
25
|
+
if (shelfMatch?.[2]) uris.push({
|
|
26
|
+
uri: `${origin}/user/${user}/${pathname.split("/")[3]}/${shelfMatch[2]}/rss`,
|
|
27
|
+
hint: require_utils.composeHint("bookwyrm:shelf")
|
|
28
|
+
});
|
|
29
|
+
uris.push({
|
|
30
|
+
uri: `${origin}/user/${user}/rss`,
|
|
31
|
+
hint: require_utils.composeHint("bookwyrm:activity")
|
|
32
|
+
}, {
|
|
33
|
+
uri: `${origin}/user/${user}/rss-reviews`,
|
|
34
|
+
hint: require_utils.composeHint("bookwyrm:reviews")
|
|
35
|
+
}, {
|
|
36
|
+
uri: `${origin}/user/${user}/rss-quotes`,
|
|
37
|
+
hint: require_utils.composeHint("bookwyrm:quotes")
|
|
38
|
+
}, {
|
|
39
|
+
uri: `${origin}/user/${user}/rss-comments`,
|
|
40
|
+
hint: require_utils.composeHint("bookwyrm:comments")
|
|
41
|
+
});
|
|
42
|
+
return uris;
|
|
43
|
+
} catch {}
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
exports.bookwyrmHandler = bookwyrmHandler;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { composeHint, hasMetaContent } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/bookwyrm.ts
|
|
3
|
+
const profileRegex = /^\/user\/([^/]+)/;
|
|
4
|
+
const shelfRegex = /^\/user\/([^/]+)\/(?:shelf|books)\/([^/]+)\/?/;
|
|
5
|
+
const isBookwyrmHtml = (content) => {
|
|
6
|
+
return hasMetaContent(content, "generator", "BookWyrm");
|
|
7
|
+
};
|
|
8
|
+
const bookwyrmHandler = {
|
|
9
|
+
match: (url, content) => {
|
|
10
|
+
try {
|
|
11
|
+
if (!content || !isBookwyrmHtml(content)) return false;
|
|
12
|
+
const { pathname } = new URL(url);
|
|
13
|
+
return profileRegex.test(pathname);
|
|
14
|
+
} catch {}
|
|
15
|
+
return false;
|
|
16
|
+
},
|
|
17
|
+
resolve: (url) => {
|
|
18
|
+
try {
|
|
19
|
+
const { origin, pathname } = new URL(url);
|
|
20
|
+
const match = pathname.match(profileRegex);
|
|
21
|
+
if (!match?.[1]) return [];
|
|
22
|
+
const user = match[1];
|
|
23
|
+
const uris = [];
|
|
24
|
+
const shelfMatch = pathname.match(shelfRegex);
|
|
25
|
+
if (shelfMatch?.[2]) uris.push({
|
|
26
|
+
uri: `${origin}/user/${user}/${pathname.split("/")[3]}/${shelfMatch[2]}/rss`,
|
|
27
|
+
hint: composeHint("bookwyrm:shelf")
|
|
28
|
+
});
|
|
29
|
+
uris.push({
|
|
30
|
+
uri: `${origin}/user/${user}/rss`,
|
|
31
|
+
hint: composeHint("bookwyrm:activity")
|
|
32
|
+
}, {
|
|
33
|
+
uri: `${origin}/user/${user}/rss-reviews`,
|
|
34
|
+
hint: composeHint("bookwyrm:reviews")
|
|
35
|
+
}, {
|
|
36
|
+
uri: `${origin}/user/${user}/rss-quotes`,
|
|
37
|
+
hint: composeHint("bookwyrm:quotes")
|
|
38
|
+
}, {
|
|
39
|
+
uri: `${origin}/user/${user}/rss-comments`,
|
|
40
|
+
hint: composeHint("bookwyrm:comments")
|
|
41
|
+
});
|
|
42
|
+
return uris;
|
|
43
|
+
} catch {}
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { bookwyrmHandler };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/buttondown.ts
|
|
3
|
+
const hosts = [
|
|
4
|
+
"buttondown.com",
|
|
5
|
+
"www.buttondown.com",
|
|
6
|
+
"buttondown.email",
|
|
7
|
+
"www.buttondown.email"
|
|
8
|
+
];
|
|
9
|
+
const excludedPaths = [
|
|
10
|
+
"about",
|
|
11
|
+
"api",
|
|
12
|
+
"blog",
|
|
13
|
+
"changelog",
|
|
14
|
+
"docs",
|
|
15
|
+
"features",
|
|
16
|
+
"help",
|
|
17
|
+
"legal",
|
|
18
|
+
"login",
|
|
19
|
+
"pricing",
|
|
20
|
+
"privacy",
|
|
21
|
+
"refer",
|
|
22
|
+
"register",
|
|
23
|
+
"settings",
|
|
24
|
+
"terms"
|
|
25
|
+
];
|
|
26
|
+
const buttondownHandler = {
|
|
27
|
+
match: (url) => {
|
|
28
|
+
return require_utils.isHostOf(url, hosts);
|
|
29
|
+
},
|
|
30
|
+
resolve: (url) => {
|
|
31
|
+
const { pathname } = new URL(url);
|
|
32
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
33
|
+
if (pathSegments.length === 0) return [];
|
|
34
|
+
const username = pathSegments[0];
|
|
35
|
+
if (require_utils.isAnyOf(username, excludedPaths)) return [];
|
|
36
|
+
return [{
|
|
37
|
+
uri: `https://buttondown.com/${username}/rss`,
|
|
38
|
+
hint: require_utils.composeHint("buttondown:newsletter")
|
|
39
|
+
}];
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.buttondownHandler = buttondownHandler;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/buttondown.ts
|
|
3
|
+
const hosts = [
|
|
4
|
+
"buttondown.com",
|
|
5
|
+
"www.buttondown.com",
|
|
6
|
+
"buttondown.email",
|
|
7
|
+
"www.buttondown.email"
|
|
8
|
+
];
|
|
9
|
+
const excludedPaths = [
|
|
10
|
+
"about",
|
|
11
|
+
"api",
|
|
12
|
+
"blog",
|
|
13
|
+
"changelog",
|
|
14
|
+
"docs",
|
|
15
|
+
"features",
|
|
16
|
+
"help",
|
|
17
|
+
"legal",
|
|
18
|
+
"login",
|
|
19
|
+
"pricing",
|
|
20
|
+
"privacy",
|
|
21
|
+
"refer",
|
|
22
|
+
"register",
|
|
23
|
+
"settings",
|
|
24
|
+
"terms"
|
|
25
|
+
];
|
|
26
|
+
const buttondownHandler = {
|
|
27
|
+
match: (url) => {
|
|
28
|
+
return isHostOf(url, hosts);
|
|
29
|
+
},
|
|
30
|
+
resolve: (url) => {
|
|
31
|
+
const { pathname } = new URL(url);
|
|
32
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
33
|
+
if (pathSegments.length === 0) return [];
|
|
34
|
+
const username = pathSegments[0];
|
|
35
|
+
if (isAnyOf(username, excludedPaths)) return [];
|
|
36
|
+
return [{
|
|
37
|
+
uri: `https://buttondown.com/${username}/rss`,
|
|
38
|
+
hint: composeHint("buttondown:newsletter")
|
|
39
|
+
}];
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { buttondownHandler };
|