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
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/lobsters.ts
|
|
3
|
-
const hosts = ["lobste.rs"];
|
|
4
|
-
const tagRegex = /^\/t\/([a-zA-Z0-9,_-]+)/;
|
|
5
|
-
const domainRegex = /^\/domains\/([^/]+)/;
|
|
6
|
-
const userRegex = /^\/~([a-zA-Z0-9_-]+)/;
|
|
7
|
-
const topRegex = /^\/top(?:\/(1d|3d|1w|1m|1y))?\/?$/;
|
|
8
|
-
const lobstersHandler = {
|
|
9
|
-
match: (url) => {
|
|
10
|
-
return require_utils.isHostOf(url, hosts);
|
|
11
|
-
},
|
|
12
|
-
resolve: (url) => {
|
|
13
|
-
const { pathname } = new URL(url);
|
|
14
|
-
const tagMatch = pathname.match(tagRegex);
|
|
15
|
-
if (tagMatch?.[1]) return [{
|
|
16
|
-
uri: `https://lobste.rs/t/${tagMatch[1]}.rss`,
|
|
17
|
-
hint: require_utils.composeHint("lobsters:tag")
|
|
18
|
-
}];
|
|
19
|
-
const domainMatch = pathname.match(domainRegex);
|
|
20
|
-
if (domainMatch?.[1]) return [{
|
|
21
|
-
uri: `https://lobste.rs/domains/${domainMatch[1]}.rss`,
|
|
22
|
-
hint: require_utils.composeHint("lobsters:domain")
|
|
23
|
-
}];
|
|
24
|
-
const userMatch = pathname.match(userRegex);
|
|
25
|
-
if (userMatch?.[1]) return [{
|
|
26
|
-
uri: `https://lobste.rs/~${userMatch[1]}/stories.rss`,
|
|
27
|
-
hint: require_utils.composeHint("lobsters:stories")
|
|
28
|
-
}];
|
|
29
|
-
const topMatch = pathname.match(topRegex);
|
|
30
|
-
if (topMatch) {
|
|
31
|
-
const period = topMatch[1];
|
|
32
|
-
if (period) return [{
|
|
33
|
-
uri: `https://lobste.rs/top/${period}/rss`,
|
|
34
|
-
hint: require_utils.composeHint("lobsters:top")
|
|
35
|
-
}];
|
|
36
|
-
return [{
|
|
37
|
-
uri: "https://lobste.rs/top/rss",
|
|
38
|
-
hint: require_utils.composeHint("lobsters:top")
|
|
39
|
-
}];
|
|
40
|
-
}
|
|
41
|
-
if (pathname === "/newest" || pathname === "/newest/") return [{
|
|
42
|
-
uri: "https://lobste.rs/newest.rss",
|
|
43
|
-
hint: require_utils.composeHint("lobsters:newest")
|
|
44
|
-
}];
|
|
45
|
-
if (pathname === "/comments" || pathname === "/comments/") return [{
|
|
46
|
-
uri: "https://lobste.rs/comments.rss",
|
|
47
|
-
hint: require_utils.composeHint("lobsters:comments")
|
|
48
|
-
}];
|
|
49
|
-
return [{
|
|
50
|
-
uri: "https://lobste.rs/rss",
|
|
51
|
-
hint: require_utils.composeHint("lobsters:stories")
|
|
52
|
-
}];
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
//#endregion
|
|
56
|
-
exports.hosts = hosts;
|
|
57
|
-
exports.lobstersHandler = lobstersHandler;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
const require_mastodon = require("../../../favicons/platform/handlers/mastodon.cjs");
|
|
3
|
-
//#region src/feeds/platform/handlers/mastodon.ts
|
|
4
|
-
const profileRegex = /^\/@([^/]+)/;
|
|
5
|
-
const tagRegex = /^\/tags\/([^/]+)/;
|
|
6
|
-
const isProfilePath = (pathname) => {
|
|
7
|
-
const segments = pathname.split("/").filter(Boolean);
|
|
8
|
-
return segments.length > 0 && segments[0].startsWith("@");
|
|
9
|
-
};
|
|
10
|
-
const isTagPath = (pathname) => {
|
|
11
|
-
const segments = pathname.split("/").filter(Boolean);
|
|
12
|
-
return segments.length >= 2 && segments[0] === "tags";
|
|
13
|
-
};
|
|
14
|
-
const mastodonHandler = {
|
|
15
|
-
match: (url, content, headers) => {
|
|
16
|
-
try {
|
|
17
|
-
const { pathname } = new URL(url);
|
|
18
|
-
if (!isProfilePath(pathname) && !isTagPath(pathname)) return false;
|
|
19
|
-
if (content && require_mastodon.isMastodonHtml(content)) return true;
|
|
20
|
-
if (headers && require_mastodon.isMastodonHeaders(headers)) return true;
|
|
21
|
-
} catch {}
|
|
22
|
-
return false;
|
|
23
|
-
},
|
|
24
|
-
resolve: (url) => {
|
|
25
|
-
try {
|
|
26
|
-
const { origin, pathname } = new URL(url);
|
|
27
|
-
const userMatch = pathname.match(profileRegex);
|
|
28
|
-
if (userMatch?.[1]) return [{
|
|
29
|
-
uri: `${origin}/@${userMatch[1]}.rss`,
|
|
30
|
-
hint: require_utils.composeHint("mastodon:posts")
|
|
31
|
-
}];
|
|
32
|
-
const tagMatch = pathname.match(tagRegex);
|
|
33
|
-
if (tagMatch?.[1]) return [{
|
|
34
|
-
uri: `${origin}/tags/${tagMatch[1]}.rss`,
|
|
35
|
-
hint: require_utils.composeHint("mastodon:tag")
|
|
36
|
-
}];
|
|
37
|
-
} catch {}
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
//#endregion
|
|
42
|
-
exports.mastodonHandler = mastodonHandler;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/medium.ts
|
|
3
|
-
const userRegex = /^\/@([^/]+)/;
|
|
4
|
-
const tagRegex = /^\/tag\/([^/]+)/;
|
|
5
|
-
const publicationTagRegex = /^\/([^/@][^/]+)\/tagged\/([^/]+)/;
|
|
6
|
-
const publicationRegex = /^\/([^/@][^/]+)/;
|
|
7
|
-
const subdomainTagRegex = /^\/tagged\/([^/]+)/;
|
|
8
|
-
const hosts = ["medium.com", "www.medium.com"];
|
|
9
|
-
const excludedPaths = [
|
|
10
|
-
"search",
|
|
11
|
-
"me",
|
|
12
|
-
"new-story",
|
|
13
|
-
"plans",
|
|
14
|
-
"membership"
|
|
15
|
-
];
|
|
16
|
-
const mediumHandler = {
|
|
17
|
-
match: (url) => {
|
|
18
|
-
return require_utils.isHostOf(url, hosts) || require_utils.isSubdomainOf(url, "medium.com");
|
|
19
|
-
},
|
|
20
|
-
resolve: (url) => {
|
|
21
|
-
const { hostname, pathname } = new URL(url);
|
|
22
|
-
const lowerHostname = hostname.toLowerCase();
|
|
23
|
-
if (hosts.includes(lowerHostname)) {
|
|
24
|
-
const userMatch = pathname.match(userRegex);
|
|
25
|
-
if (userMatch?.[1]) return [{
|
|
26
|
-
uri: `https://medium.com/feed/@${userMatch[1]}`,
|
|
27
|
-
hint: require_utils.composeHint("medium:posts")
|
|
28
|
-
}];
|
|
29
|
-
const tagMatch = pathname.match(tagRegex);
|
|
30
|
-
if (tagMatch?.[1]) return [{
|
|
31
|
-
uri: `https://medium.com/feed/tag/${tagMatch[1]}`,
|
|
32
|
-
hint: require_utils.composeHint("medium:tag")
|
|
33
|
-
}];
|
|
34
|
-
const pubTagMatch = pathname.match(publicationTagRegex);
|
|
35
|
-
if (pubTagMatch?.[1] && pubTagMatch?.[2]) {
|
|
36
|
-
const publication = pubTagMatch[1];
|
|
37
|
-
const tag = pubTagMatch[2];
|
|
38
|
-
if (!require_utils.isAnyOf(publication, excludedPaths)) return [{
|
|
39
|
-
uri: `https://medium.com/feed/${publication}/tagged/${tag}`,
|
|
40
|
-
hint: require_utils.composeHint("medium:tagged")
|
|
41
|
-
}];
|
|
42
|
-
}
|
|
43
|
-
const pubMatch = pathname.match(publicationRegex);
|
|
44
|
-
if (pubMatch?.[1]) {
|
|
45
|
-
const publication = pubMatch[1];
|
|
46
|
-
if (!require_utils.isAnyOf(publication, excludedPaths)) return [{
|
|
47
|
-
uri: `https://medium.com/feed/${publication}`,
|
|
48
|
-
hint: require_utils.composeHint("medium:publication")
|
|
49
|
-
}];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (lowerHostname.endsWith(".medium.com") && lowerHostname !== "medium.com" && lowerHostname !== "www.medium.com") {
|
|
53
|
-
const subdomain = lowerHostname.replace(".medium.com", "");
|
|
54
|
-
const tagMatch = pathname.match(subdomainTagRegex);
|
|
55
|
-
if (tagMatch?.[1]) return [{
|
|
56
|
-
uri: `https://medium.com/feed/${subdomain}/tagged/${tagMatch[1]}`,
|
|
57
|
-
hint: require_utils.composeHint("medium:tagged")
|
|
58
|
-
}];
|
|
59
|
-
return [{
|
|
60
|
-
uri: `https://medium.com/feed/${subdomain}`,
|
|
61
|
-
hint: require_utils.composeHint("medium:publication")
|
|
62
|
-
}];
|
|
63
|
-
}
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
exports.mediumHandler = mediumHandler;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/paragraph.ts
|
|
3
|
-
const hosts = ["paragraph.com", "www.paragraph.com"];
|
|
4
|
-
const userRegex = /^\/@([^/]+)/;
|
|
5
|
-
const paragraphHandler = {
|
|
6
|
-
match: (url) => {
|
|
7
|
-
return require_utils.isHostOf(url, hosts);
|
|
8
|
-
},
|
|
9
|
-
resolve: (url) => {
|
|
10
|
-
const { pathname } = new URL(url);
|
|
11
|
-
const userMatch = pathname.match(userRegex);
|
|
12
|
-
if (!userMatch?.[1]) return [];
|
|
13
|
-
const username = userMatch[1];
|
|
14
|
-
return [{
|
|
15
|
-
uri: [`https://paragraph.com/@${username}/feed`, `https://paragraph.com/@${username}/rss`],
|
|
16
|
-
hint: require_utils.composeHint("paragraph:blog")
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
exports.paragraphHandler = paragraphHandler;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/pinterest.ts
|
|
3
|
-
const hosts = [
|
|
4
|
-
"pinterest.com",
|
|
5
|
-
"www.pinterest.com",
|
|
6
|
-
"pin.it"
|
|
7
|
-
];
|
|
8
|
-
const excludedPaths = [
|
|
9
|
-
"_",
|
|
10
|
-
"about",
|
|
11
|
-
"business",
|
|
12
|
-
"convert",
|
|
13
|
-
"explore",
|
|
14
|
-
"ideas",
|
|
15
|
-
"login",
|
|
16
|
-
"news_hub",
|
|
17
|
-
"password",
|
|
18
|
-
"pin",
|
|
19
|
-
"privacy",
|
|
20
|
-
"resource",
|
|
21
|
-
"search",
|
|
22
|
-
"settings",
|
|
23
|
-
"terms",
|
|
24
|
-
"today",
|
|
25
|
-
"topics"
|
|
26
|
-
];
|
|
27
|
-
const pinterestHandler = {
|
|
28
|
-
match: (url) => {
|
|
29
|
-
return require_utils.isHostOf(url, hosts);
|
|
30
|
-
},
|
|
31
|
-
resolve: (url) => {
|
|
32
|
-
const { pathname } = new URL(url);
|
|
33
|
-
const pathSegments = pathname.split("/").filter(Boolean);
|
|
34
|
-
if (pathSegments.length === 0) return [];
|
|
35
|
-
const username = pathSegments[0];
|
|
36
|
-
if (require_utils.isAnyOf(username, excludedPaths)) return [];
|
|
37
|
-
return [{
|
|
38
|
-
uri: `https://www.pinterest.com/${username}/feed.rss`,
|
|
39
|
-
hint: require_utils.composeHint("pinterest:pins")
|
|
40
|
-
}];
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
//#endregion
|
|
44
|
-
exports.pinterestHandler = pinterestHandler;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/producthunt.ts
|
|
3
|
-
const hosts = ["producthunt.com", "www.producthunt.com"];
|
|
4
|
-
const topicRegex = /^\/topics\/([a-zA-Z0-9_-]+)/;
|
|
5
|
-
const categoryRegex = /^\/categories\/([a-zA-Z0-9_-]+)/;
|
|
6
|
-
const producthuntHandler = {
|
|
7
|
-
match: (url) => {
|
|
8
|
-
return require_utils.isHostOf(url, hosts);
|
|
9
|
-
},
|
|
10
|
-
resolve: (url) => {
|
|
11
|
-
const { pathname } = new URL(url);
|
|
12
|
-
const topicMatch = pathname.match(topicRegex);
|
|
13
|
-
if (topicMatch?.[1]) return [{
|
|
14
|
-
uri: `https://www.producthunt.com/feed?topic=${topicMatch[1]}`,
|
|
15
|
-
hint: require_utils.composeHint("producthunt:topic")
|
|
16
|
-
}];
|
|
17
|
-
const categoryMatch = pathname.match(categoryRegex);
|
|
18
|
-
if (categoryMatch?.[1]) return [{
|
|
19
|
-
uri: `https://www.producthunt.com/feed?category=${categoryMatch[1]}`,
|
|
20
|
-
hint: require_utils.composeHint("producthunt:category")
|
|
21
|
-
}];
|
|
22
|
-
return [{
|
|
23
|
-
uri: "https://www.producthunt.com/feed",
|
|
24
|
-
hint: require_utils.composeHint("producthunt:products")
|
|
25
|
-
}];
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
exports.producthuntHandler = producthuntHandler;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/reddit.ts
|
|
3
|
-
const commentsRegex = /^\/r\/([^/]+)\/comments\/([^/]+)/;
|
|
4
|
-
const subredditRegex = /^\/r\/([^/]+)(?:\/([^/]+))?/;
|
|
5
|
-
const multiredditRegex = /^\/user\/([^/]+)\/m\/([^/]+)/;
|
|
6
|
-
const userRegex = /^\/(u|user)\/([^/]+)/;
|
|
7
|
-
const domainRegex = /^\/domain\/([^/]+)/;
|
|
8
|
-
const hosts = [
|
|
9
|
-
"reddit.com",
|
|
10
|
-
"www.reddit.com",
|
|
11
|
-
"old.reddit.com",
|
|
12
|
-
"new.reddit.com"
|
|
13
|
-
];
|
|
14
|
-
const sortOptions = [
|
|
15
|
-
"hot",
|
|
16
|
-
"new",
|
|
17
|
-
"rising",
|
|
18
|
-
"controversial",
|
|
19
|
-
"top"
|
|
20
|
-
];
|
|
21
|
-
const redditHandler = {
|
|
22
|
-
match: (url) => {
|
|
23
|
-
return require_utils.isHostOf(url, hosts);
|
|
24
|
-
},
|
|
25
|
-
resolve: (url) => {
|
|
26
|
-
const { pathname } = new URL(url);
|
|
27
|
-
if (pathname.split("/").filter(Boolean).length === 0) return [{
|
|
28
|
-
uri: "https://www.reddit.com/.rss",
|
|
29
|
-
hint: require_utils.composeHint("reddit:posts")
|
|
30
|
-
}];
|
|
31
|
-
const commentsMatch = pathname.match(commentsRegex);
|
|
32
|
-
if (commentsMatch?.[1] && commentsMatch?.[2]) return [{
|
|
33
|
-
uri: `https://www.reddit.com/r/${commentsMatch[1]}/comments/${commentsMatch[2]}/.rss`,
|
|
34
|
-
hint: require_utils.composeHint("reddit:post-comments")
|
|
35
|
-
}];
|
|
36
|
-
const subredditMatch = pathname.match(subredditRegex);
|
|
37
|
-
if (subredditMatch?.[1]) {
|
|
38
|
-
const subreddit = subredditMatch[1];
|
|
39
|
-
const sort = subredditMatch[2];
|
|
40
|
-
const uris = [];
|
|
41
|
-
if (sort && require_utils.isAnyOf(sort, sortOptions)) uris.push({
|
|
42
|
-
uri: `https://www.reddit.com/r/${subreddit}/${sort}/.rss`,
|
|
43
|
-
hint: require_utils.composeHint("reddit:posts")
|
|
44
|
-
});
|
|
45
|
-
else uris.push({
|
|
46
|
-
uri: `https://www.reddit.com/r/${subreddit}/.rss`,
|
|
47
|
-
hint: require_utils.composeHint("reddit:posts")
|
|
48
|
-
});
|
|
49
|
-
uris.push({
|
|
50
|
-
uri: `https://www.reddit.com/r/${subreddit}/comments/.rss`,
|
|
51
|
-
hint: require_utils.composeHint("reddit:comments")
|
|
52
|
-
});
|
|
53
|
-
return uris;
|
|
54
|
-
}
|
|
55
|
-
const multiredditMatch = pathname.match(multiredditRegex);
|
|
56
|
-
if (multiredditMatch?.[1] && multiredditMatch?.[2]) return [{
|
|
57
|
-
uri: `https://www.reddit.com/user/${multiredditMatch[1]}/m/${multiredditMatch[2]}/.rss`,
|
|
58
|
-
hint: require_utils.composeHint("reddit:multireddit")
|
|
59
|
-
}];
|
|
60
|
-
const userMatch = pathname.match(userRegex);
|
|
61
|
-
if (userMatch?.[2]) return [{
|
|
62
|
-
uri: `https://www.reddit.com/user/${userMatch[2]}/.rss`,
|
|
63
|
-
hint: require_utils.composeHint("reddit:posts")
|
|
64
|
-
}];
|
|
65
|
-
const domainMatch = pathname.match(domainRegex);
|
|
66
|
-
if (domainMatch?.[1]) return [{
|
|
67
|
-
uri: `https://www.reddit.com/domain/${domainMatch[1]}/.rss`,
|
|
68
|
-
hint: require_utils.composeHint("reddit:posts")
|
|
69
|
-
}];
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
//#endregion
|
|
74
|
-
exports.hosts = hosts;
|
|
75
|
-
exports.redditHandler = redditHandler;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/soundcloud.ts
|
|
3
|
-
const userIdRegex = /soundcloud:\/\/users:(\d+)/;
|
|
4
|
-
const hosts = [
|
|
5
|
-
"soundcloud.com",
|
|
6
|
-
"www.soundcloud.com",
|
|
7
|
-
"m.soundcloud.com"
|
|
8
|
-
];
|
|
9
|
-
const excludedPaths = [
|
|
10
|
-
"discover",
|
|
11
|
-
"stream",
|
|
12
|
-
"search",
|
|
13
|
-
"upload",
|
|
14
|
-
"you",
|
|
15
|
-
"settings",
|
|
16
|
-
"messages"
|
|
17
|
-
];
|
|
18
|
-
const extractUserIdFromContent = (content) => {
|
|
19
|
-
return content.match(userIdRegex)?.[1];
|
|
20
|
-
};
|
|
21
|
-
const soundcloudHandler = {
|
|
22
|
-
match: (url) => {
|
|
23
|
-
if (!require_utils.isHostOf(url, hosts)) return false;
|
|
24
|
-
const { pathname } = new URL(url);
|
|
25
|
-
const pathSegments = pathname.split("/").filter(Boolean);
|
|
26
|
-
return pathSegments.length > 0 && !require_utils.isAnyOf(pathSegments[0], excludedPaths);
|
|
27
|
-
},
|
|
28
|
-
resolve: (_url, content) => {
|
|
29
|
-
if (!content) return [];
|
|
30
|
-
const userId = extractUserIdFromContent(content);
|
|
31
|
-
if (!userId) return [];
|
|
32
|
-
return [{
|
|
33
|
-
uri: `https://feeds.soundcloud.com/users/soundcloud:users:${userId}/sounds.rss`,
|
|
34
|
-
hint: require_utils.composeHint("soundcloud:tracks")
|
|
35
|
-
}];
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
exports.soundcloudHandler = soundcloudHandler;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/sourceforge.ts
|
|
3
|
-
const hosts = ["sourceforge.net", "www.sourceforge.net"];
|
|
4
|
-
const sourceforgeHandler = {
|
|
5
|
-
match: (url) => {
|
|
6
|
-
return require_utils.isHostOf(url, hosts);
|
|
7
|
-
},
|
|
8
|
-
resolve: (url) => {
|
|
9
|
-
const { origin, pathname } = new URL(url);
|
|
10
|
-
const pathSegments = pathname.split("/").filter(Boolean);
|
|
11
|
-
if (pathSegments[0] === "projects" && pathSegments[1]) return [{
|
|
12
|
-
uri: `${origin}/projects/${pathSegments[1]}/rss`,
|
|
13
|
-
hint: require_utils.composeHint("sourceforge:activity")
|
|
14
|
-
}];
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.hosts = hosts;
|
|
20
|
-
exports.sourceforgeHandler = sourceforgeHandler;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/stackExchange.ts
|
|
3
|
-
const tagRegex = /^\/questions\/tagged\/([\w.+-]+)/;
|
|
4
|
-
const questionRegex = /^\/questions\/(\d+)/;
|
|
5
|
-
const userRegex = /^\/users\/(\d+)/;
|
|
6
|
-
const domains = [
|
|
7
|
-
"stackoverflow.com",
|
|
8
|
-
"serverfault.com",
|
|
9
|
-
"superuser.com",
|
|
10
|
-
"askubuntu.com",
|
|
11
|
-
"stackapps.com",
|
|
12
|
-
"mathoverflow.net",
|
|
13
|
-
"stackexchange.com"
|
|
14
|
-
];
|
|
15
|
-
const stackExchangeHandler = {
|
|
16
|
-
match: (url) => {
|
|
17
|
-
return require_utils.isHostOf(url, domains) || require_utils.isSubdomainOf(url, domains);
|
|
18
|
-
},
|
|
19
|
-
resolve: (url) => {
|
|
20
|
-
const { origin, pathname } = new URL(url);
|
|
21
|
-
const tagMatch = pathname.match(tagRegex);
|
|
22
|
-
if (tagMatch?.[1]) return [{
|
|
23
|
-
uri: `${origin}/feeds/tag/${tagMatch[1]}`,
|
|
24
|
-
hint: require_utils.composeHint("stackexchange:tag")
|
|
25
|
-
}];
|
|
26
|
-
const questionMatch = pathname.match(questionRegex);
|
|
27
|
-
if (questionMatch?.[1]) return [{
|
|
28
|
-
uri: `${origin}/feeds/question/${questionMatch[1]}`,
|
|
29
|
-
hint: require_utils.composeHint("stackexchange:question")
|
|
30
|
-
}];
|
|
31
|
-
const userMatch = pathname.match(userRegex);
|
|
32
|
-
if (userMatch?.[1]) return [{
|
|
33
|
-
uri: `${origin}/feeds/user/${userMatch[1]}`,
|
|
34
|
-
hint: require_utils.composeHint("stackexchange:user")
|
|
35
|
-
}];
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
exports.stackExchangeHandler = stackExchangeHandler;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/steam.ts
|
|
3
|
-
const appRegex = /^\/(?:news\/)?app\/(\d+)/;
|
|
4
|
-
const groupRegex = /^\/groups\/([^/]+)/;
|
|
5
|
-
const hosts = ["store.steampowered.com", "steamcommunity.com"];
|
|
6
|
-
const steamHandler = {
|
|
7
|
-
match: (url) => {
|
|
8
|
-
return require_utils.isHostOf(url, hosts);
|
|
9
|
-
},
|
|
10
|
-
resolve: (url) => {
|
|
11
|
-
const { hostname, pathname } = new URL(url);
|
|
12
|
-
const appMatch = pathname.match(appRegex);
|
|
13
|
-
if (appMatch?.[1]) return [{
|
|
14
|
-
uri: `https://store.steampowered.com/feeds/news/app/${appMatch[1]}/`,
|
|
15
|
-
hint: require_utils.composeHint("steam:news")
|
|
16
|
-
}];
|
|
17
|
-
if (hostname === "steamcommunity.com") {
|
|
18
|
-
const groupMatch = pathname.match(groupRegex);
|
|
19
|
-
if (groupMatch?.[1]) return [{
|
|
20
|
-
uri: `https://steamcommunity.com/groups/${groupMatch[1]}/rss`,
|
|
21
|
-
hint: require_utils.composeHint("steam:group")
|
|
22
|
-
}];
|
|
23
|
-
}
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
//#endregion
|
|
28
|
-
exports.steamHandler = steamHandler;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/substack.ts
|
|
3
|
-
const profileRegex = /^\/@([\w-]+)/;
|
|
4
|
-
const substackHandler = {
|
|
5
|
-
match: (url) => {
|
|
6
|
-
if (require_utils.isSubdomainOf(url, "substack.com")) return true;
|
|
7
|
-
return require_utils.isHostOf(url, "substack.com") && profileRegex.test(new URL(url).pathname);
|
|
8
|
-
},
|
|
9
|
-
resolve: (url) => {
|
|
10
|
-
const parsed = new URL(url);
|
|
11
|
-
const profileMatch = parsed.pathname.match(profileRegex);
|
|
12
|
-
if (require_utils.isHostOf(url, "substack.com") && profileMatch?.[1]) return [{
|
|
13
|
-
uri: `https://${profileMatch[1]}.substack.com/feed`,
|
|
14
|
-
hint: require_utils.composeHint("substack:newsletter")
|
|
15
|
-
}];
|
|
16
|
-
return [{
|
|
17
|
-
uri: `${parsed.origin}/feed`,
|
|
18
|
-
hint: require_utils.composeHint("substack:newsletter")
|
|
19
|
-
}];
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.substackHandler = substackHandler;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/tumblr.ts
|
|
3
|
-
const domains = ["tumblr.com"];
|
|
4
|
-
const tagRegex = /^\/tagged\/([^/]+)/;
|
|
5
|
-
const tumblrHandler = {
|
|
6
|
-
match: (url) => {
|
|
7
|
-
return require_utils.isSubdomainOf(url, domains);
|
|
8
|
-
},
|
|
9
|
-
resolve: (url) => {
|
|
10
|
-
const { origin, pathname } = new URL(url);
|
|
11
|
-
const tagMatch = pathname.match(tagRegex);
|
|
12
|
-
if (tagMatch?.[1]) return [{
|
|
13
|
-
uri: `${origin}/tagged/${tagMatch[1]}/rss`,
|
|
14
|
-
hint: require_utils.composeHint("tumblr:tag")
|
|
15
|
-
}];
|
|
16
|
-
return [{
|
|
17
|
-
uri: `${origin}/rss`,
|
|
18
|
-
hint: require_utils.composeHint("tumblr:posts")
|
|
19
|
-
}];
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.domains = domains;
|
|
24
|
-
exports.tumblrHandler = tumblrHandler;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/v2ex.ts
|
|
3
|
-
const nodeRegex = /^\/go\/([^/]+)/;
|
|
4
|
-
const memberRegex = /^\/member\/([^/]+)/;
|
|
5
|
-
const hosts = ["www.v2ex.com", "v2ex.com"];
|
|
6
|
-
const v2exHandler = {
|
|
7
|
-
match: (url) => {
|
|
8
|
-
return require_utils.isHostOf(url, hosts);
|
|
9
|
-
},
|
|
10
|
-
resolve: (url) => {
|
|
11
|
-
const { pathname, searchParams } = new URL(url);
|
|
12
|
-
const nodeMatch = pathname.match(nodeRegex);
|
|
13
|
-
if (nodeMatch?.[1]) return [{
|
|
14
|
-
uri: `https://www.v2ex.com/feed/${nodeMatch[1]}.xml`,
|
|
15
|
-
hint: require_utils.composeHint("v2ex:node")
|
|
16
|
-
}];
|
|
17
|
-
const memberMatch = pathname.match(memberRegex);
|
|
18
|
-
if (memberMatch?.[1]) return [{
|
|
19
|
-
uri: `https://www.v2ex.com/feed/member/${memberMatch[1]}.xml`,
|
|
20
|
-
hint: require_utils.composeHint("v2ex:member")
|
|
21
|
-
}];
|
|
22
|
-
const tab = searchParams.get("tab");
|
|
23
|
-
if (tab) return [{
|
|
24
|
-
uri: `https://www.v2ex.com/feed/tab/${tab}.xml`,
|
|
25
|
-
hint: require_utils.composeHint("v2ex:tab")
|
|
26
|
-
}];
|
|
27
|
-
if (pathname === "/" || pathname === "") return [{
|
|
28
|
-
uri: "https://www.v2ex.com/index.xml",
|
|
29
|
-
hint: require_utils.composeHint("v2ex:index")
|
|
30
|
-
}];
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
//#endregion
|
|
35
|
-
exports.v2exHandler = v2exHandler;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/vimeo.ts
|
|
3
|
-
const numericRegex = /^\d+$/;
|
|
4
|
-
const hosts = ["vimeo.com", "www.vimeo.com"];
|
|
5
|
-
const excludedPaths = [
|
|
6
|
-
"about",
|
|
7
|
-
"blog",
|
|
8
|
-
"business",
|
|
9
|
-
"careers",
|
|
10
|
-
"categories",
|
|
11
|
-
"channels",
|
|
12
|
-
"create",
|
|
13
|
-
"enterprise",
|
|
14
|
-
"explore",
|
|
15
|
-
"features",
|
|
16
|
-
"for-hire",
|
|
17
|
-
"groups",
|
|
18
|
-
"help",
|
|
19
|
-
"join",
|
|
20
|
-
"log_in",
|
|
21
|
-
"manage",
|
|
22
|
-
"ondemand",
|
|
23
|
-
"ott",
|
|
24
|
-
"plus",
|
|
25
|
-
"pricing",
|
|
26
|
-
"pro",
|
|
27
|
-
"search",
|
|
28
|
-
"settings",
|
|
29
|
-
"site_map",
|
|
30
|
-
"solutions",
|
|
31
|
-
"stock",
|
|
32
|
-
"upload",
|
|
33
|
-
"upgrade",
|
|
34
|
-
"watch"
|
|
35
|
-
];
|
|
36
|
-
const vimeoHandler = {
|
|
37
|
-
match: (url) => {
|
|
38
|
-
return require_utils.isHostOf(url, hosts);
|
|
39
|
-
},
|
|
40
|
-
resolve: (url) => {
|
|
41
|
-
const { origin, pathname } = new URL(url);
|
|
42
|
-
const pathSegments = pathname.split("/").filter(Boolean);
|
|
43
|
-
if (pathSegments[0] === "channels" && pathSegments[1]) return [{
|
|
44
|
-
uri: `${origin}/channels/${pathSegments[1]}/videos/rss`,
|
|
45
|
-
hint: require_utils.composeHint("vimeo:channel")
|
|
46
|
-
}];
|
|
47
|
-
if (pathSegments[0] === "groups" && pathSegments[1]) return [{
|
|
48
|
-
uri: `${origin}/groups/${pathSegments[1]}/videos/rss`,
|
|
49
|
-
hint: require_utils.composeHint("vimeo:group")
|
|
50
|
-
}];
|
|
51
|
-
if (pathSegments.length > 0) {
|
|
52
|
-
const user = pathSegments[0];
|
|
53
|
-
if (!require_utils.isAnyOf(user, excludedPaths) && !numericRegex.test(user)) {
|
|
54
|
-
const feeds = [{
|
|
55
|
-
uri: `${origin}/${user}/videos/rss`,
|
|
56
|
-
hint: require_utils.composeHint("vimeo:videos")
|
|
57
|
-
}];
|
|
58
|
-
if (pathSegments[1] === "likes") feeds.unshift({
|
|
59
|
-
uri: `${origin}/${user}/likes/rss`,
|
|
60
|
-
hint: require_utils.composeHint("vimeo:likes")
|
|
61
|
-
});
|
|
62
|
-
return feeds;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
//#endregion
|
|
69
|
-
exports.vimeoHandler = vimeoHandler;
|