feedscout 1.8.0 → 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/blogrolls/extractors.d.ts +2 -2
- package/dist/blogrolls/extractors.js +2 -2
- package/dist/blogrolls/index.js +4 -5
- package/dist/blogrolls.d.ts +2 -2
- package/dist/blogrolls.js +2 -2
- package/dist/common/discover/defaults.d.ts +6 -0
- package/dist/common/discover/defaults.js +44 -0
- package/dist/common/discover/index.js +2 -2
- package/dist/common/discover/utils.d.ts +3 -6
- package/dist/common/discover/utils.js +1 -28
- package/dist/common/locales.js +214 -10
- package/dist/common/types.d.ts +3 -2
- 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 +13 -11
- package/dist/favicons/extractors.d.ts +2 -2
- package/dist/favicons/extractors.js +2 -2
- package/dist/favicons/index.js +4 -5
- package/dist/favicons.d.ts +2 -2
- package/dist/favicons.js +2 -2
- package/dist/feeds/defaults.d.ts +2 -1
- package/dist/feeds/defaults.js +116 -9
- package/dist/feeds/extractors.d.ts +2 -2
- package/dist/feeds/extractors.js +6 -6
- package/dist/feeds/index.js +4 -5
- 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 +3 -3
- package/dist/feeds.js +3 -3
- package/dist/hubs/discover/index.js +3 -3
- package/dist/hubs/feed/index.js +2 -2
- package/dist/hubs/headers/index.js +2 -2
- package/dist/hubs/html/index.js +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- 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 -26
- 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/index.cjs +0 -105
- package/dist/common/discover/utils.cjs +0 -130
- package/dist/common/discover/utils.d.cts +0 -8
- 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 -97
- 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 -30
- 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 -27
- 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 -12
- package/dist/index.d.cts +0 -7
- 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,68 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/nebula.ts
|
|
3
|
+
const hosts = ["nebula.tv", "www.nebula.tv"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"classes",
|
|
7
|
+
"library",
|
|
8
|
+
"login",
|
|
9
|
+
"originals",
|
|
10
|
+
"pricing",
|
|
11
|
+
"privacy",
|
|
12
|
+
"search",
|
|
13
|
+
"settings",
|
|
14
|
+
"signup",
|
|
15
|
+
"terms"
|
|
16
|
+
];
|
|
17
|
+
const globalPaths = new Set(["videos", "explore"]);
|
|
18
|
+
const nebulaHandler = {
|
|
19
|
+
match: (url) => {
|
|
20
|
+
return isHostOf(url, hosts);
|
|
21
|
+
},
|
|
22
|
+
resolve: (url) => {
|
|
23
|
+
const { pathname, searchParams } = new URL(url);
|
|
24
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
25
|
+
if (pathSegments.length === 0 || globalPaths.has(pathSegments[0])) {
|
|
26
|
+
const rawCategory = searchParams.get("category");
|
|
27
|
+
const category = rawCategory ? rawCategory.toLowerCase() : null;
|
|
28
|
+
const uris = [];
|
|
29
|
+
if (category) {
|
|
30
|
+
uris.push({
|
|
31
|
+
uri: `https://rss.nebula.app/video/categories/${category}.rss`,
|
|
32
|
+
hint: composeHint("nebula:category")
|
|
33
|
+
});
|
|
34
|
+
uris.push({
|
|
35
|
+
uri: `https://rss.nebula.app/video/categories/${category}.rss?plus=true`,
|
|
36
|
+
hint: composeHint("nebula:category-plus")
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
uris.push({
|
|
40
|
+
uri: "https://rss.nebula.app/video.rss",
|
|
41
|
+
hint: composeHint("nebula:videos-all")
|
|
42
|
+
});
|
|
43
|
+
uris.push({
|
|
44
|
+
uri: "https://rss.nebula.app/video.rss?plus=true",
|
|
45
|
+
hint: composeHint("nebula:videos-all-plus")
|
|
46
|
+
});
|
|
47
|
+
uris.push({
|
|
48
|
+
uri: "https://rss.nebula.app/video/channels.rss",
|
|
49
|
+
hint: composeHint("nebula:channels")
|
|
50
|
+
});
|
|
51
|
+
return uris;
|
|
52
|
+
}
|
|
53
|
+
const slug = pathSegments[0];
|
|
54
|
+
if (isAnyOf(slug, excludedPaths)) return [];
|
|
55
|
+
const uris = [];
|
|
56
|
+
uris.push({
|
|
57
|
+
uri: `https://rss.nebula.app/video/channels/${slug}.rss`,
|
|
58
|
+
hint: composeHint("nebula:videos")
|
|
59
|
+
});
|
|
60
|
+
uris.push({
|
|
61
|
+
uri: `https://rss.nebula.app/video/channels/${slug}.rss?plus=true`,
|
|
62
|
+
hint: composeHint("nebula:videos-plus")
|
|
63
|
+
});
|
|
64
|
+
return uris;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { nebulaHandler };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/note.ts
|
|
3
|
+
const hosts = ["note.com", "www.note.com"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"api",
|
|
7
|
+
"explore",
|
|
8
|
+
"hashtag",
|
|
9
|
+
"help",
|
|
10
|
+
"login",
|
|
11
|
+
"m",
|
|
12
|
+
"n",
|
|
13
|
+
"premium",
|
|
14
|
+
"privacy",
|
|
15
|
+
"ranking",
|
|
16
|
+
"search",
|
|
17
|
+
"settings",
|
|
18
|
+
"signup",
|
|
19
|
+
"terms"
|
|
20
|
+
];
|
|
21
|
+
const hashtagRegex = /^\/hashtag\/([^/]+)/;
|
|
22
|
+
const magazineRegex = /^\/([^/]+)\/m\/([^/]+)/;
|
|
23
|
+
const noteHandler = {
|
|
24
|
+
match: (url) => {
|
|
25
|
+
return isHostOf(url, hosts);
|
|
26
|
+
},
|
|
27
|
+
resolve: (url) => {
|
|
28
|
+
const { pathname } = new URL(url);
|
|
29
|
+
const hashtagMatch = pathname.match(hashtagRegex);
|
|
30
|
+
if (hashtagMatch?.[1]) return [{
|
|
31
|
+
uri: `https://note.com/hashtag/${hashtagMatch[1]}/rss`,
|
|
32
|
+
hint: composeHint("note:hashtag")
|
|
33
|
+
}];
|
|
34
|
+
const magazineMatch = pathname.match(magazineRegex);
|
|
35
|
+
if (magazineMatch?.[1] && magazineMatch?.[2]) return [{
|
|
36
|
+
uri: `https://note.com/${magazineMatch[1]}/m/${magazineMatch[2]}/rss`,
|
|
37
|
+
hint: composeHint("note:magazine")
|
|
38
|
+
}];
|
|
39
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
40
|
+
if (pathSegments.length === 0) return [{
|
|
41
|
+
uri: "https://note.com/rss",
|
|
42
|
+
hint: composeHint("note:featured")
|
|
43
|
+
}];
|
|
44
|
+
const username = pathSegments[0];
|
|
45
|
+
if (isAnyOf(username, excludedPaths)) return [];
|
|
46
|
+
return [{
|
|
47
|
+
uri: `https://note.com/${username}/rss`,
|
|
48
|
+
hint: composeHint("note:blog")
|
|
49
|
+
}];
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { noteHandler };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/observable.ts
|
|
3
|
+
const hosts = ["observablehq.com", "www.observablehq.com"];
|
|
4
|
+
const collectionRegex = /^\/@([^/]+)\/collection\/([^/]+)/;
|
|
5
|
+
const userRegex = /^\/@([^/]+)/;
|
|
6
|
+
const observableHandler = {
|
|
7
|
+
match: (url) => {
|
|
8
|
+
return isHostOf(url, hosts);
|
|
9
|
+
},
|
|
10
|
+
resolve: (url) => {
|
|
11
|
+
const { pathname } = new URL(url);
|
|
12
|
+
if (pathname === "/recent" || pathname === "/recent/") return [{
|
|
13
|
+
uri: "https://api.observablehq.com/documents/public.rss",
|
|
14
|
+
hint: composeHint("observable:recent")
|
|
15
|
+
}];
|
|
16
|
+
if (pathname === "/trending" || pathname === "/trending/") return [{
|
|
17
|
+
uri: "https://api.observablehq.com/documents/trending.rss",
|
|
18
|
+
hint: composeHint("observable:trending")
|
|
19
|
+
}];
|
|
20
|
+
const collectionMatch = pathname.match(collectionRegex);
|
|
21
|
+
if (collectionMatch?.[1] && collectionMatch?.[2]) return [{
|
|
22
|
+
uri: `https://api.observablehq.com/collection/@${collectionMatch[1]}/${collectionMatch[2]}.rss`,
|
|
23
|
+
hint: composeHint("observable:collection")
|
|
24
|
+
}];
|
|
25
|
+
const userMatch = pathname.match(userRegex);
|
|
26
|
+
if (!userMatch?.[1]) return [];
|
|
27
|
+
return [{
|
|
28
|
+
uri: `https://api.observablehq.com/documents/@${userMatch[1]}.rss`,
|
|
29
|
+
hint: composeHint("observable:notebooks")
|
|
30
|
+
}];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { observableHandler };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/odysee.ts
|
|
3
|
+
const hosts = ["odysee.com", "www.odysee.com"];
|
|
4
|
+
const channelRegex = /^\/(@[^/:]+:[a-f0-9]+)/i;
|
|
5
|
+
const odyseeHandler = {
|
|
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
|
+
return [{
|
|
14
|
+
uri: `https://odysee.com/$/rss/${match[1]}`,
|
|
15
|
+
hint: composeHint("odysee:videos")
|
|
16
|
+
}];
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { odyseeHandler };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { composeHint, isHostOf, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/pagecord.ts
|
|
3
|
+
const pagecordHandler = {
|
|
4
|
+
match: (url) => {
|
|
5
|
+
return isSubdomainOf(url, "pagecord.com") && !isHostOf(url, "www.pagecord.com");
|
|
6
|
+
},
|
|
7
|
+
resolve: (url) => {
|
|
8
|
+
const { origin } = new URL(url);
|
|
9
|
+
return [{
|
|
10
|
+
uri: `${origin}/feed.xml`,
|
|
11
|
+
hint: composeHint("pagecord:blog")
|
|
12
|
+
}];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { pagecordHandler };
|
|
@@ -10,9 +10,8 @@ const paragraphHandler = {
|
|
|
10
10
|
const { pathname } = new URL(url);
|
|
11
11
|
const userMatch = pathname.match(userRegex);
|
|
12
12
|
if (!userMatch?.[1]) return [];
|
|
13
|
-
const username = userMatch[1];
|
|
14
13
|
return [{
|
|
15
|
-
uri:
|
|
14
|
+
uri: `https://api.paragraph.com/blogs/rss/@${userMatch[1]}`,
|
|
16
15
|
hint: composeHint("paragraph:blog")
|
|
17
16
|
}];
|
|
18
17
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/pika.ts
|
|
3
|
+
const tagRegex = /^\/tag\/([^/]+)/;
|
|
4
|
+
const pikaHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isSubdomainOf(url, "pika.page");
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { origin, pathname } = new URL(url);
|
|
10
|
+
const uris = [];
|
|
11
|
+
const tagMatch = pathname.match(tagRegex);
|
|
12
|
+
if (tagMatch?.[1]) {
|
|
13
|
+
const tag = tagMatch[1];
|
|
14
|
+
uris.push({
|
|
15
|
+
uri: `${origin}/tag/${tag}/feed`,
|
|
16
|
+
hint: composeHint("pika:tag-atom")
|
|
17
|
+
});
|
|
18
|
+
uris.push({
|
|
19
|
+
uri: `${origin}/tag/${tag}/feed.rss`,
|
|
20
|
+
hint: composeHint("pika:tag-rss")
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
uris.push({
|
|
24
|
+
uri: `${origin}/posts_feed`,
|
|
25
|
+
hint: composeHint("pika:posts-atom")
|
|
26
|
+
});
|
|
27
|
+
uris.push({
|
|
28
|
+
uri: `${origin}/posts_feed.rss`,
|
|
29
|
+
hint: composeHint("pika:posts-rss")
|
|
30
|
+
});
|
|
31
|
+
return uris;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { pikaHandler };
|
|
@@ -34,6 +34,19 @@ const pinterestHandler = {
|
|
|
34
34
|
if (pathSegments.length === 0) return [];
|
|
35
35
|
const username = pathSegments[0];
|
|
36
36
|
if (isAnyOf(username, excludedPaths)) return [];
|
|
37
|
+
const reservedBoardSlugs = new Set([
|
|
38
|
+
"pins",
|
|
39
|
+
"boards",
|
|
40
|
+
"_saved",
|
|
41
|
+
"_created",
|
|
42
|
+
"followers",
|
|
43
|
+
"following"
|
|
44
|
+
]);
|
|
45
|
+
const board = pathSegments[1];
|
|
46
|
+
if (board && !reservedBoardSlugs.has(board)) return [{
|
|
47
|
+
uri: `https://www.pinterest.com/${username}/${board}.rss`,
|
|
48
|
+
hint: composeHint("pinterest:board")
|
|
49
|
+
}];
|
|
37
50
|
return [{
|
|
38
51
|
uri: `https://www.pinterest.com/${username}/feed.rss`,
|
|
39
52
|
hint: composeHint("pinterest:pins")
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { composeHint, hasMetaContent } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/pixelfed.ts
|
|
3
|
+
const profileRegex = /^\/(?:users\/)?([a-zA-Z0-9_]+)\/?$/;
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"admin",
|
|
6
|
+
"api",
|
|
7
|
+
"discover",
|
|
8
|
+
"i",
|
|
9
|
+
"login",
|
|
10
|
+
"notifications",
|
|
11
|
+
"p",
|
|
12
|
+
"register",
|
|
13
|
+
"settings",
|
|
14
|
+
"site",
|
|
15
|
+
"storage",
|
|
16
|
+
"timeline",
|
|
17
|
+
"users"
|
|
18
|
+
];
|
|
19
|
+
const isPixelfedHtml = (content) => {
|
|
20
|
+
return hasMetaContent(content, "generator", "pixelfed");
|
|
21
|
+
};
|
|
22
|
+
const pixelfedHandler = {
|
|
23
|
+
match: (url, content) => {
|
|
24
|
+
try {
|
|
25
|
+
if (!content || !isPixelfedHtml(content)) return false;
|
|
26
|
+
const { pathname } = new URL(url);
|
|
27
|
+
const match = pathname.match(profileRegex);
|
|
28
|
+
return Boolean(match?.[1] && !excludedPaths.includes(match[1]));
|
|
29
|
+
} catch {}
|
|
30
|
+
return false;
|
|
31
|
+
},
|
|
32
|
+
resolve: (url) => {
|
|
33
|
+
try {
|
|
34
|
+
const { origin, pathname } = new URL(url);
|
|
35
|
+
const match = pathname.match(profileRegex);
|
|
36
|
+
if (!match?.[1] || excludedPaths.includes(match[1])) return [];
|
|
37
|
+
return [{
|
|
38
|
+
uri: `${origin}/users/${match[1]}.atom`,
|
|
39
|
+
hint: composeHint("pixelfed:posts")
|
|
40
|
+
}];
|
|
41
|
+
} catch {}
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { pixelfedHandler };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { composeHint } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/pleroma.ts
|
|
3
|
+
const profileRegex = /^\/users\/([^/]+)/;
|
|
4
|
+
const pleromaApiRegex = /\/api\/pleroma\//i;
|
|
5
|
+
const isPleromaHtml = (content) => {
|
|
6
|
+
return pleromaApiRegex.test(content);
|
|
7
|
+
};
|
|
8
|
+
const pleromaHandler = {
|
|
9
|
+
match: (url, content) => {
|
|
10
|
+
try {
|
|
11
|
+
if (!content || !isPleromaHtml(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
|
+
return [{
|
|
23
|
+
uri: `${origin}/users/${match[1]}/feed.atom`,
|
|
24
|
+
hint: composeHint("pleroma:posts")
|
|
25
|
+
}, {
|
|
26
|
+
uri: `${origin}/users/${match[1]}/feed.rss`,
|
|
27
|
+
hint: composeHint("pleroma:posts-rss")
|
|
28
|
+
}];
|
|
29
|
+
} catch {}
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { pleromaHandler };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/podbean.ts
|
|
3
|
+
const domainSuffix = /\.podbean\.com$/i;
|
|
4
|
+
const reservedSlugs = new Set([
|
|
5
|
+
"www",
|
|
6
|
+
"feed",
|
|
7
|
+
"pbcdn1",
|
|
8
|
+
"sponsorship",
|
|
9
|
+
"podads",
|
|
10
|
+
"help",
|
|
11
|
+
"blog",
|
|
12
|
+
"support"
|
|
13
|
+
]);
|
|
14
|
+
const podbeanHandler = {
|
|
15
|
+
match: (url) => {
|
|
16
|
+
if (!isSubdomainOf(url, "podbean.com")) return false;
|
|
17
|
+
const slug = new URL(url).hostname.toLowerCase().replace(domainSuffix, "");
|
|
18
|
+
return !reservedSlugs.has(slug);
|
|
19
|
+
},
|
|
20
|
+
resolve: (url) => {
|
|
21
|
+
const { hostname } = new URL(url);
|
|
22
|
+
return [{
|
|
23
|
+
uri: `https://feed.podbean.com/${hostname.replace(domainSuffix, "")}/feed.xml`,
|
|
24
|
+
hint: composeHint("podbean:podcast")
|
|
25
|
+
}];
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { podbeanHandler };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/podigee.ts
|
|
3
|
+
const domainSuffix = /\.podigee\.io$/i;
|
|
4
|
+
const reservedSlugs = new Set([
|
|
5
|
+
"www",
|
|
6
|
+
"app",
|
|
7
|
+
"help",
|
|
8
|
+
"hilfe",
|
|
9
|
+
"blog",
|
|
10
|
+
"status",
|
|
11
|
+
"player",
|
|
12
|
+
"cdn"
|
|
13
|
+
]);
|
|
14
|
+
const podigeeHandler = {
|
|
15
|
+
match: (url) => {
|
|
16
|
+
if (!isSubdomainOf(url, "podigee.io")) return false;
|
|
17
|
+
const slug = new URL(url).hostname.toLowerCase().replace(domainSuffix, "");
|
|
18
|
+
return !reservedSlugs.has(slug);
|
|
19
|
+
},
|
|
20
|
+
resolve: (url) => {
|
|
21
|
+
const { origin } = new URL(url);
|
|
22
|
+
return [{
|
|
23
|
+
uri: `${origin}/feed/mp3`,
|
|
24
|
+
hint: composeHint("podigee:podcast")
|
|
25
|
+
}];
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { podigeeHandler };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/posthaven.ts
|
|
3
|
+
const tagRegex = /^\/tag\/([^/]+)/;
|
|
4
|
+
const posthavenHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isSubdomainOf(url, "posthaven.com");
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { origin, pathname } = new URL(url);
|
|
10
|
+
const uris = [];
|
|
11
|
+
const tagMatch = pathname.match(tagRegex);
|
|
12
|
+
if (tagMatch?.[1]) uris.push({
|
|
13
|
+
uri: `${origin}/tag/${tagMatch[1]}.atom`,
|
|
14
|
+
hint: composeHint("posthaven:tag")
|
|
15
|
+
});
|
|
16
|
+
uris.push({
|
|
17
|
+
uri: `${origin}/posts.atom`,
|
|
18
|
+
hint: composeHint("posthaven:posts")
|
|
19
|
+
});
|
|
20
|
+
return uris;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { posthavenHandler };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { composeHint, isHostOf, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/prose.ts
|
|
3
|
+
const apexHosts = ["prose.sh", "www.prose.sh"];
|
|
4
|
+
const proseHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isSubdomainOf(url, "prose.sh") || isHostOf(url, apexHosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { origin, searchParams } = new URL(url);
|
|
10
|
+
if (isHostOf(url, apexHosts)) return [{
|
|
11
|
+
uri: "https://prose.sh/rss",
|
|
12
|
+
hint: composeHint("prose:discovery")
|
|
13
|
+
}];
|
|
14
|
+
const tag = searchParams.get("tag");
|
|
15
|
+
if (tag) return [{
|
|
16
|
+
uri: `${origin}/rss?tag=${encodeURIComponent(tag)}`,
|
|
17
|
+
hint: composeHint("prose:tag")
|
|
18
|
+
}];
|
|
19
|
+
return [{
|
|
20
|
+
uri: `${origin}/rss`,
|
|
21
|
+
hint: composeHint("prose:blog")
|
|
22
|
+
}];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { proseHandler };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/qiita.ts
|
|
3
|
+
const hosts = ["qiita.com", "www.qiita.com"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"api",
|
|
7
|
+
"login",
|
|
8
|
+
"official-columns",
|
|
9
|
+
"organizations",
|
|
10
|
+
"popular-items",
|
|
11
|
+
"privacy",
|
|
12
|
+
"search",
|
|
13
|
+
"settings",
|
|
14
|
+
"signup",
|
|
15
|
+
"tags",
|
|
16
|
+
"terms",
|
|
17
|
+
"trend"
|
|
18
|
+
];
|
|
19
|
+
const tagRegex = /^\/tags\/([^/]+)/;
|
|
20
|
+
const organizationRegex = /^\/organizations\/([^/]+)/;
|
|
21
|
+
const popularItemsRegex = /^\/popular-items(\/|$)/;
|
|
22
|
+
const officialColumnsRegex = /^\/official-columns(\/|$)/;
|
|
23
|
+
const qiitaHandler = {
|
|
24
|
+
match: (url) => {
|
|
25
|
+
return isHostOf(url, hosts);
|
|
26
|
+
},
|
|
27
|
+
resolve: (url) => {
|
|
28
|
+
const { pathname } = new URL(url);
|
|
29
|
+
const tagMatch = pathname.match(tagRegex);
|
|
30
|
+
if (tagMatch?.[1]) return [{
|
|
31
|
+
uri: `https://qiita.com/tags/${tagMatch[1]}/feed.atom`,
|
|
32
|
+
hint: composeHint("qiita:tag")
|
|
33
|
+
}];
|
|
34
|
+
const orgMatch = pathname.match(organizationRegex);
|
|
35
|
+
if (orgMatch?.[1]) return [{
|
|
36
|
+
uri: `https://qiita.com/organizations/${orgMatch[1]}/activities.atom`,
|
|
37
|
+
hint: composeHint("qiita:organization")
|
|
38
|
+
}];
|
|
39
|
+
if (popularItemsRegex.test(pathname)) return [{
|
|
40
|
+
uri: "https://qiita.com/popular-items/feed.atom",
|
|
41
|
+
hint: composeHint("qiita:popular")
|
|
42
|
+
}];
|
|
43
|
+
if (officialColumnsRegex.test(pathname)) return [{
|
|
44
|
+
uri: "https://qiita.com/official-columns/feed/",
|
|
45
|
+
hint: composeHint("qiita:zine")
|
|
46
|
+
}];
|
|
47
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
48
|
+
if (pathSegments.length === 0) return [];
|
|
49
|
+
const username = pathSegments[0];
|
|
50
|
+
if (isAnyOf(username, excludedPaths)) return [];
|
|
51
|
+
return [{
|
|
52
|
+
uri: `https://qiita.com/${username}/feed.atom`,
|
|
53
|
+
hint: composeHint("qiita:posts")
|
|
54
|
+
}];
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { qiitaHandler };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
2
|
//#region src/feeds/platform/handlers/reddit.ts
|
|
3
3
|
const commentsRegex = /^\/r\/([^/]+)\/comments\/([^/]+)/;
|
|
4
|
+
const subredditWikiRegex = /^\/r\/([^/]+)\/wiki/;
|
|
5
|
+
const subredditSearchRegex = /^\/r\/([^/]+)\/search/;
|
|
4
6
|
const subredditRegex = /^\/r\/([^/]+)(?:\/([^/]+))?/;
|
|
5
7
|
const multiredditRegex = /^\/user\/([^/]+)\/m\/([^/]+)/;
|
|
6
|
-
const userRegex = /^\/(u|user)\/([^/]+)
|
|
8
|
+
const userRegex = /^\/(?:u|user)\/([^/]+)(?:\/(submitted|comments))?/;
|
|
7
9
|
const domainRegex = /^\/domain\/([^/]+)/;
|
|
10
|
+
const subredditsRegex = /^\/(?:subreddits|reddits)(?:\/(new|popular))?/;
|
|
8
11
|
const hosts = [
|
|
9
12
|
"reddit.com",
|
|
10
13
|
"www.reddit.com",
|
|
@@ -16,18 +19,71 @@ const sortOptions = [
|
|
|
16
19
|
"new",
|
|
17
20
|
"rising",
|
|
18
21
|
"controversial",
|
|
19
|
-
"top"
|
|
22
|
+
"top",
|
|
23
|
+
"best"
|
|
20
24
|
];
|
|
25
|
+
const timeOptions = new Set([
|
|
26
|
+
"hour",
|
|
27
|
+
"day",
|
|
28
|
+
"week",
|
|
29
|
+
"month",
|
|
30
|
+
"year",
|
|
31
|
+
"all"
|
|
32
|
+
]);
|
|
33
|
+
const timeFilteredSorts = new Set(["top", "controversial"]);
|
|
34
|
+
const getTimeframeSuffix = (sort, searchParams) => {
|
|
35
|
+
if (!timeFilteredSorts.has(sort)) return "";
|
|
36
|
+
const timeframe = searchParams.get("t");
|
|
37
|
+
if (timeframe && timeOptions.has(timeframe)) return `?t=${timeframe}`;
|
|
38
|
+
return "";
|
|
39
|
+
};
|
|
21
40
|
const redditHandler = {
|
|
22
41
|
match: (url) => {
|
|
23
42
|
return isHostOf(url, hosts);
|
|
24
43
|
},
|
|
25
44
|
resolve: (url) => {
|
|
26
|
-
const { pathname } = new URL(url);
|
|
27
|
-
|
|
45
|
+
const { pathname, searchParams } = new URL(url);
|
|
46
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
47
|
+
if (pathSegments.length === 0) return [{
|
|
28
48
|
uri: "https://www.reddit.com/.rss",
|
|
29
49
|
hint: composeHint("reddit:posts")
|
|
30
50
|
}];
|
|
51
|
+
if (pathSegments.length === 1 && isAnyOf(pathSegments[0], sortOptions)) {
|
|
52
|
+
const sort = pathSegments[0];
|
|
53
|
+
return [{
|
|
54
|
+
uri: `https://www.reddit.com/${sort}/.rss${getTimeframeSuffix(sort, searchParams)}`,
|
|
55
|
+
hint: composeHint("reddit:posts")
|
|
56
|
+
}];
|
|
57
|
+
}
|
|
58
|
+
if (pathSegments[0] === "search") {
|
|
59
|
+
const query = searchParams.get("q");
|
|
60
|
+
if (query) return [{
|
|
61
|
+
uri: `https://www.reddit.com/search.rss?q=${encodeURIComponent(query)}`,
|
|
62
|
+
hint: composeHint("reddit:search")
|
|
63
|
+
}];
|
|
64
|
+
}
|
|
65
|
+
const subredditsMatch = pathname.match(subredditsRegex);
|
|
66
|
+
if (subredditsMatch) {
|
|
67
|
+
const sort = subredditsMatch[1];
|
|
68
|
+
return [{
|
|
69
|
+
uri: `https://www.reddit.com/${sort ? `subreddits/${sort}` : "subreddits"}/.rss`,
|
|
70
|
+
hint: composeHint("reddit:subreddits")
|
|
71
|
+
}];
|
|
72
|
+
}
|
|
73
|
+
const subredditSearchMatch = pathname.match(subredditSearchRegex);
|
|
74
|
+
if (subredditSearchMatch?.[1]) {
|
|
75
|
+
const subreddit = subredditSearchMatch[1];
|
|
76
|
+
const query = searchParams.get("q");
|
|
77
|
+
if (query) return [{
|
|
78
|
+
uri: `https://www.reddit.com/r/${subreddit}/search.rss?q=${encodeURIComponent(query)}&restrict_sr=on`,
|
|
79
|
+
hint: composeHint("reddit:search")
|
|
80
|
+
}];
|
|
81
|
+
}
|
|
82
|
+
const subredditWikiMatch = pathname.match(subredditWikiRegex);
|
|
83
|
+
if (subredditWikiMatch?.[1]) return [{
|
|
84
|
+
uri: `https://www.reddit.com/r/${subredditWikiMatch[1]}/wiki/index.rss`,
|
|
85
|
+
hint: composeHint("reddit:wiki")
|
|
86
|
+
}];
|
|
31
87
|
const commentsMatch = pathname.match(commentsRegex);
|
|
32
88
|
if (commentsMatch?.[1] && commentsMatch?.[2]) return [{
|
|
33
89
|
uri: `https://www.reddit.com/r/${commentsMatch[1]}/comments/${commentsMatch[2]}/.rss`,
|
|
@@ -39,7 +95,7 @@ const redditHandler = {
|
|
|
39
95
|
const sort = subredditMatch[2];
|
|
40
96
|
const uris = [];
|
|
41
97
|
if (sort && isAnyOf(sort, sortOptions)) uris.push({
|
|
42
|
-
uri: `https://www.reddit.com/r/${subreddit}/${sort}/.rss`,
|
|
98
|
+
uri: `https://www.reddit.com/r/${subreddit}/${sort}/.rss${getTimeframeSuffix(sort, searchParams)}`,
|
|
43
99
|
hint: composeHint("reddit:posts")
|
|
44
100
|
});
|
|
45
101
|
else uris.push({
|
|
@@ -58,10 +114,28 @@ const redditHandler = {
|
|
|
58
114
|
hint: composeHint("reddit:multireddit")
|
|
59
115
|
}];
|
|
60
116
|
const userMatch = pathname.match(userRegex);
|
|
61
|
-
if (userMatch?.[
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
117
|
+
if (userMatch?.[1]) {
|
|
118
|
+
const username = userMatch[1];
|
|
119
|
+
const filter = userMatch[2];
|
|
120
|
+
if (filter === "submitted") return [{
|
|
121
|
+
uri: `https://www.reddit.com/user/${username}/submitted/.rss`,
|
|
122
|
+
hint: composeHint("reddit:user-submitted")
|
|
123
|
+
}, {
|
|
124
|
+
uri: `https://www.reddit.com/user/${username}/.rss`,
|
|
125
|
+
hint: composeHint("reddit:posts")
|
|
126
|
+
}];
|
|
127
|
+
if (filter === "comments") return [{
|
|
128
|
+
uri: `https://www.reddit.com/user/${username}/comments/.rss`,
|
|
129
|
+
hint: composeHint("reddit:user-comments")
|
|
130
|
+
}, {
|
|
131
|
+
uri: `https://www.reddit.com/user/${username}/.rss`,
|
|
132
|
+
hint: composeHint("reddit:posts")
|
|
133
|
+
}];
|
|
134
|
+
return [{
|
|
135
|
+
uri: `https://www.reddit.com/user/${username}/.rss`,
|
|
136
|
+
hint: composeHint("reddit:posts")
|
|
137
|
+
}];
|
|
138
|
+
}
|
|
65
139
|
const domainMatch = pathname.match(domainRegex);
|
|
66
140
|
if (domainMatch?.[1]) return [{
|
|
67
141
|
uri: `https://www.reddit.com/domain/${domainMatch[1]}/.rss`,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/rssCom.ts
|
|
3
|
+
const hosts = ["rss.com", "www.rss.com"];
|
|
4
|
+
const podcastRegex = /^\/(?:[a-z]{2}\/)?podcasts\/([^/]+)/;
|
|
5
|
+
const rssComHandler = {
|
|
6
|
+
match: (url) => {
|
|
7
|
+
return isHostOf(url, hosts);
|
|
8
|
+
},
|
|
9
|
+
resolve: (url) => {
|
|
10
|
+
const { pathname } = new URL(url);
|
|
11
|
+
const match = pathname.match(podcastRegex);
|
|
12
|
+
if (!match?.[1]) return [];
|
|
13
|
+
return [{
|
|
14
|
+
uri: `https://media.rss.com/${match[1]}/feed.xml`,
|
|
15
|
+
hint: composeHint("rss-com:podcast")
|
|
16
|
+
}];
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { rssComHandler };
|