feedscout 1.4.0 → 1.6.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 +12 -17
- package/dist/blogrolls/defaults.cjs +1 -3
- package/dist/blogrolls/defaults.js +1 -2
- package/dist/blogrolls/extractors.cjs +6 -9
- package/dist/blogrolls/extractors.js +6 -9
- package/dist/blogrolls/index.cjs +6 -9
- package/dist/blogrolls/index.d.cts +1 -1
- package/dist/blogrolls/index.d.ts +1 -1
- package/dist/blogrolls/index.js +1 -4
- package/dist/blogrolls.cjs +4 -5
- package/dist/blogrolls.js +1 -2
- package/dist/common/discover/index.cjs +60 -21
- package/dist/common/discover/index.js +58 -19
- package/dist/common/discover/utils.cjs +30 -9
- package/dist/common/discover/utils.js +28 -8
- package/dist/common/locales.cjs +127 -8
- package/dist/common/locales.js +116 -2
- package/dist/common/types.cjs +10 -0
- package/dist/common/types.d.cts +23 -5
- package/dist/common/types.d.ts +23 -5
- package/dist/common/types.js +10 -0
- package/dist/common/uris/feed/index.cjs +12 -0
- package/dist/common/uris/feed/index.d.cts +6 -0
- package/dist/common/uris/feed/index.d.ts +6 -0
- package/dist/common/uris/feed/index.js +12 -0
- package/dist/common/uris/feed/types.d.cts +9 -0
- package/dist/common/uris/feed/types.d.ts +9 -0
- package/dist/common/uris/guess/index.cjs +2 -4
- package/dist/common/uris/guess/index.d.cts +2 -1
- package/dist/common/uris/guess/index.d.ts +2 -1
- package/dist/common/uris/guess/index.js +1 -3
- package/dist/common/uris/guess/types.d.cts +3 -1
- package/dist/common/uris/guess/types.d.ts +3 -1
- package/dist/common/uris/guess/utils.cjs +5 -4
- package/dist/common/uris/guess/utils.d.cts +3 -1
- package/dist/common/uris/guess/utils.d.ts +3 -1
- package/dist/common/uris/guess/utils.js +5 -3
- package/dist/common/uris/headers/index.cjs +2 -4
- package/dist/common/uris/headers/index.js +1 -3
- package/dist/common/uris/html/handlers.cjs +2 -4
- package/dist/common/uris/html/handlers.js +1 -3
- package/dist/common/uris/html/index.cjs +2 -4
- package/dist/common/uris/html/index.js +1 -3
- package/dist/common/uris/index.cjs +23 -17
- package/dist/common/uris/index.js +19 -13
- package/dist/common/uris/platform/index.cjs +3 -5
- package/dist/common/uris/platform/index.d.cts +7 -0
- package/dist/common/uris/platform/index.d.ts +7 -0
- package/dist/common/uris/platform/index.js +3 -4
- package/dist/common/uris/platform/types.d.cts +4 -2
- package/dist/common/uris/platform/types.d.ts +4 -2
- package/dist/common/utils.cjs +25 -8
- package/dist/common/utils.d.cts +2 -2
- package/dist/common/utils.d.ts +2 -2
- package/dist/common/utils.js +23 -7
- package/dist/favicons/defaults.cjs +60 -0
- package/dist/favicons/defaults.d.cts +18 -0
- package/dist/favicons/defaults.d.ts +18 -0
- package/dist/favicons/defaults.js +53 -0
- package/dist/favicons/extractors.cjs +13 -0
- package/dist/favicons/extractors.d.cts +7 -0
- package/dist/favicons/extractors.d.ts +7 -0
- package/dist/favicons/extractors.js +13 -0
- package/dist/favicons/index.cjs +29 -0
- package/dist/favicons/index.d.cts +7 -0
- package/dist/favicons/index.d.ts +7 -0
- package/dist/favicons/index.js +29 -0
- package/dist/favicons/platform/handlers/bluesky.cjs +27 -0
- package/dist/favicons/platform/handlers/bluesky.js +27 -0
- package/dist/favicons/platform/handlers/codeberg.cjs +18 -0
- package/dist/favicons/platform/handlers/codeberg.js +18 -0
- package/dist/favicons/platform/handlers/deviantart.cjs +29 -0
- package/dist/favicons/platform/handlers/deviantart.js +29 -0
- package/dist/favicons/platform/handlers/github.cjs +18 -0
- package/dist/favicons/platform/handlers/github.js +18 -0
- package/dist/favicons/platform/handlers/githubGist.cjs +18 -0
- package/dist/favicons/platform/handlers/githubGist.js +18 -0
- package/dist/favicons/platform/handlers/lobsters.cjs +21 -0
- package/dist/favicons/platform/handlers/lobsters.js +21 -0
- package/dist/favicons/platform/handlers/mastodon.cjs +36 -0
- package/dist/favicons/platform/handlers/mastodon.js +34 -0
- package/dist/favicons/platform/handlers/reddit.cjs +41 -0
- package/dist/favicons/platform/handlers/reddit.js +41 -0
- package/dist/favicons/platform/handlers/sourceforge.cjs +21 -0
- package/dist/favicons/platform/handlers/sourceforge.js +21 -0
- package/dist/favicons/platform/handlers/tumblr.cjs +16 -0
- package/dist/favicons/platform/handlers/tumblr.js +16 -0
- package/dist/favicons/types.d.cts +4 -0
- package/dist/favicons/types.d.ts +4 -0
- package/dist/favicons.cjs +12 -0
- package/dist/favicons.d.cts +4 -0
- package/dist/favicons.d.ts +4 -0
- package/dist/favicons.js +3 -0
- package/dist/feeds/defaults.cjs +66 -37
- package/dist/feeds/defaults.d.cts +2 -2
- package/dist/feeds/defaults.d.ts +2 -2
- package/dist/feeds/defaults.js +52 -23
- package/dist/feeds/extractors.cjs +1 -3
- package/dist/feeds/extractors.js +1 -3
- package/dist/feeds/index.cjs +6 -8
- package/dist/feeds/index.d.cts +1 -1
- package/dist/feeds/index.d.ts +1 -1
- package/dist/feeds/index.js +1 -3
- package/dist/feeds/platform/handlers/behance.cjs +10 -6
- package/dist/feeds/platform/handlers/behance.js +10 -6
- package/dist/feeds/platform/handlers/blogspot.cjs +19 -8
- package/dist/feeds/platform/handlers/blogspot.js +19 -7
- package/dist/feeds/platform/handlers/bluesky.cjs +7 -6
- package/dist/feeds/platform/handlers/bluesky.js +7 -6
- package/dist/feeds/platform/handlers/codeberg.cjs +69 -0
- package/dist/feeds/platform/handlers/codeberg.js +67 -0
- package/dist/feeds/platform/handlers/csdn.cjs +19 -0
- package/dist/feeds/platform/handlers/csdn.js +19 -0
- package/dist/feeds/platform/handlers/dailymotion.cjs +10 -6
- package/dist/feeds/platform/handlers/dailymotion.js +10 -6
- package/dist/feeds/platform/handlers/deviantart.cjs +20 -8
- package/dist/feeds/platform/handlers/deviantart.js +18 -8
- package/dist/feeds/platform/handlers/devto.cjs +10 -6
- package/dist/feeds/platform/handlers/devto.js +10 -6
- package/dist/feeds/platform/handlers/douban.cjs +54 -0
- package/dist/feeds/platform/handlers/douban.js +54 -0
- package/dist/feeds/platform/handlers/github.cjs +37 -16
- package/dist/feeds/platform/handlers/github.js +35 -16
- package/dist/feeds/platform/handlers/githubGist.cjs +17 -17
- package/dist/feeds/platform/handlers/githubGist.js +15 -17
- package/dist/feeds/platform/handlers/gitlab.cjs +18 -8
- package/dist/feeds/platform/handlers/gitlab.js +18 -8
- package/dist/feeds/platform/handlers/goodreads.cjs +39 -0
- package/dist/feeds/platform/handlers/goodreads.js +39 -0
- package/dist/feeds/platform/handlers/hashnode.cjs +16 -0
- package/dist/feeds/platform/handlers/hashnode.js +16 -0
- package/dist/feeds/platform/handlers/hatenablog.cjs +53 -0
- package/dist/feeds/platform/handlers/hatenablog.js +53 -0
- package/dist/feeds/platform/handlers/itchio.cjs +88 -0
- package/dist/feeds/platform/handlers/itchio.js +88 -0
- package/dist/feeds/platform/handlers/kickstarter.cjs +10 -6
- package/dist/feeds/platform/handlers/kickstarter.js +10 -6
- package/dist/feeds/platform/handlers/letterboxd.cjs +42 -0
- package/dist/feeds/platform/handlers/letterboxd.js +42 -0
- package/dist/feeds/platform/handlers/lobsters.cjs +35 -12
- package/dist/feeds/platform/handlers/lobsters.js +34 -12
- package/dist/feeds/platform/handlers/mastodon.cjs +40 -0
- package/dist/feeds/platform/handlers/mastodon.js +40 -0
- package/dist/feeds/platform/handlers/medium.cjs +26 -10
- package/dist/feeds/platform/handlers/medium.js +26 -10
- package/dist/feeds/platform/handlers/paragraph.cjs +21 -0
- package/dist/feeds/platform/handlers/paragraph.js +21 -0
- package/dist/feeds/platform/handlers/pinterest.cjs +6 -10
- package/dist/feeds/platform/handlers/pinterest.js +6 -10
- package/dist/feeds/platform/handlers/producthunt.cjs +14 -7
- package/dist/feeds/platform/handlers/producthunt.js +14 -7
- package/dist/feeds/platform/handlers/reddit.cjs +35 -12
- package/dist/feeds/platform/handlers/reddit.js +34 -12
- package/dist/feeds/platform/handlers/soundcloud.cjs +6 -5
- package/dist/feeds/platform/handlers/soundcloud.js +6 -5
- package/dist/feeds/platform/handlers/sourceforge.cjs +20 -0
- package/dist/feeds/platform/handlers/sourceforge.js +19 -0
- package/dist/feeds/platform/handlers/stackExchange.cjs +37 -0
- package/dist/feeds/platform/handlers/stackExchange.js +37 -0
- package/dist/feeds/platform/handlers/steam.cjs +26 -0
- package/dist/feeds/platform/handlers/steam.js +26 -0
- package/dist/feeds/platform/handlers/substack.cjs +6 -5
- package/dist/feeds/platform/handlers/substack.js +6 -5
- package/dist/feeds/platform/handlers/tumblr.cjs +13 -7
- package/dist/feeds/platform/handlers/tumblr.js +12 -7
- package/dist/feeds/platform/handlers/v2ex.cjs +33 -0
- package/dist/feeds/platform/handlers/v2ex.js +33 -0
- package/dist/feeds/platform/handlers/vimeo.cjs +68 -0
- package/dist/feeds/platform/handlers/vimeo.js +68 -0
- package/dist/feeds/platform/handlers/wordpress.cjs +46 -12
- package/dist/feeds/platform/handlers/wordpress.js +46 -12
- package/dist/feeds/platform/handlers/wpengine.cjs +10 -0
- package/dist/feeds/platform/handlers/wpengine.js +11 -0
- package/dist/feeds/platform/handlers/ximalaya.cjs +19 -0
- package/dist/feeds/platform/handlers/ximalaya.js +19 -0
- package/dist/feeds/platform/handlers/youtube.cjs +35 -13
- package/dist/feeds/platform/handlers/youtube.js +35 -13
- package/dist/feeds.cjs +4 -5
- package/dist/feeds.js +1 -2
- package/dist/hubs/discover/index.cjs +7 -9
- package/dist/hubs/discover/index.js +1 -3
- package/dist/hubs/discover/utils.cjs +1 -3
- package/dist/hubs/discover/utils.js +1 -2
- package/dist/hubs/feed/index.cjs +1 -3
- package/dist/hubs/feed/index.js +1 -3
- package/dist/hubs/headers/index.cjs +3 -5
- package/dist/hubs/headers/index.js +1 -3
- package/dist/hubs/html/index.cjs +3 -5
- package/dist/hubs/html/index.js +1 -3
- package/dist/hubs.js +1 -1
- package/dist/index.cjs +8 -7
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/methods.cjs +13 -10
- package/dist/methods.d.cts +3 -1
- package/dist/methods.d.ts +3 -1
- package/dist/methods.js +3 -2
- package/dist/utils.cjs +3 -4
- package/dist/utils.js +1 -2
- package/package.json +15 -5
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/codeberg.ts
|
|
3
|
+
const hosts = [
|
|
4
|
+
"codeberg.org",
|
|
5
|
+
"www.codeberg.org",
|
|
6
|
+
"gitea.com",
|
|
7
|
+
"www.gitea.com"
|
|
8
|
+
];
|
|
9
|
+
const excludedPaths = [
|
|
10
|
+
"explore",
|
|
11
|
+
"admin",
|
|
12
|
+
"user",
|
|
13
|
+
"assets",
|
|
14
|
+
"api",
|
|
15
|
+
"swagger.json",
|
|
16
|
+
"robots.txt",
|
|
17
|
+
"sitemap.xml",
|
|
18
|
+
"-"
|
|
19
|
+
];
|
|
20
|
+
const codebergHandler = {
|
|
21
|
+
match: (url) => {
|
|
22
|
+
return require_utils.isHostOf(url, hosts);
|
|
23
|
+
},
|
|
24
|
+
resolve: (url) => {
|
|
25
|
+
const { origin, pathname } = new URL(url);
|
|
26
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
27
|
+
if (pathSegments.length === 1) {
|
|
28
|
+
const user = pathSegments[0];
|
|
29
|
+
if (!require_utils.isAnyOf(user, excludedPaths)) return [{
|
|
30
|
+
uri: `${origin}/${user}.rss`,
|
|
31
|
+
hint: require_utils.composeHint("codeberg:activity")
|
|
32
|
+
}];
|
|
33
|
+
}
|
|
34
|
+
if (pathSegments.length >= 2) {
|
|
35
|
+
const user = pathSegments[0];
|
|
36
|
+
const repo = pathSegments[1];
|
|
37
|
+
if (!require_utils.isAnyOf(user, excludedPaths)) {
|
|
38
|
+
const feeds = [
|
|
39
|
+
{
|
|
40
|
+
uri: `${origin}/${user}/${repo}/releases.rss`,
|
|
41
|
+
hint: require_utils.composeHint("codeberg:releases")
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
uri: `${origin}/${user}/${repo}/tags.rss`,
|
|
45
|
+
hint: require_utils.composeHint("codeberg:tags")
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
uri: `${origin}/${user}/${repo}.rss`,
|
|
49
|
+
hint: require_utils.composeHint("codeberg:activity")
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
if (pathSegments[2] === "src" && pathSegments[3] === "branch" && pathSegments[4]) {
|
|
53
|
+
const branch = pathSegments[4];
|
|
54
|
+
const filePath = pathSegments.slice(5).join("/");
|
|
55
|
+
feeds.unshift({
|
|
56
|
+
uri: `${origin}/${user}/${repo}/rss/branch/${branch}${filePath ? `/${filePath}` : ""}`,
|
|
57
|
+
hint: require_utils.composeHint(filePath ? "codeberg:file-history" : "codeberg:branch-commits")
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return feeds;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
exports.codebergHandler = codebergHandler;
|
|
68
|
+
exports.excludedPaths = excludedPaths;
|
|
69
|
+
exports.hosts = hosts;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/codeberg.ts
|
|
3
|
+
const hosts = [
|
|
4
|
+
"codeberg.org",
|
|
5
|
+
"www.codeberg.org",
|
|
6
|
+
"gitea.com",
|
|
7
|
+
"www.gitea.com"
|
|
8
|
+
];
|
|
9
|
+
const excludedPaths = [
|
|
10
|
+
"explore",
|
|
11
|
+
"admin",
|
|
12
|
+
"user",
|
|
13
|
+
"assets",
|
|
14
|
+
"api",
|
|
15
|
+
"swagger.json",
|
|
16
|
+
"robots.txt",
|
|
17
|
+
"sitemap.xml",
|
|
18
|
+
"-"
|
|
19
|
+
];
|
|
20
|
+
const codebergHandler = {
|
|
21
|
+
match: (url) => {
|
|
22
|
+
return isHostOf(url, hosts);
|
|
23
|
+
},
|
|
24
|
+
resolve: (url) => {
|
|
25
|
+
const { origin, pathname } = new URL(url);
|
|
26
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
27
|
+
if (pathSegments.length === 1) {
|
|
28
|
+
const user = pathSegments[0];
|
|
29
|
+
if (!isAnyOf(user, excludedPaths)) return [{
|
|
30
|
+
uri: `${origin}/${user}.rss`,
|
|
31
|
+
hint: composeHint("codeberg:activity")
|
|
32
|
+
}];
|
|
33
|
+
}
|
|
34
|
+
if (pathSegments.length >= 2) {
|
|
35
|
+
const user = pathSegments[0];
|
|
36
|
+
const repo = pathSegments[1];
|
|
37
|
+
if (!isAnyOf(user, excludedPaths)) {
|
|
38
|
+
const feeds = [
|
|
39
|
+
{
|
|
40
|
+
uri: `${origin}/${user}/${repo}/releases.rss`,
|
|
41
|
+
hint: composeHint("codeberg:releases")
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
uri: `${origin}/${user}/${repo}/tags.rss`,
|
|
45
|
+
hint: composeHint("codeberg:tags")
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
uri: `${origin}/${user}/${repo}.rss`,
|
|
49
|
+
hint: composeHint("codeberg:activity")
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
if (pathSegments[2] === "src" && pathSegments[3] === "branch" && pathSegments[4]) {
|
|
53
|
+
const branch = pathSegments[4];
|
|
54
|
+
const filePath = pathSegments.slice(5).join("/");
|
|
55
|
+
feeds.unshift({
|
|
56
|
+
uri: `${origin}/${user}/${repo}/rss/branch/${branch}${filePath ? `/${filePath}` : ""}`,
|
|
57
|
+
hint: composeHint(filePath ? "codeberg:file-history" : "codeberg:branch-commits")
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return feeds;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { codebergHandler, excludedPaths, hosts };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/csdn.ts
|
|
3
|
+
const hosts = ["blog.csdn.net"];
|
|
4
|
+
const csdnHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return require_utils.isHostOf(url, hosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { pathname } = new URL(url);
|
|
10
|
+
const username = pathname.match(/^\/([^/]+)/)?.[1];
|
|
11
|
+
if (!username) return [];
|
|
12
|
+
return [{
|
|
13
|
+
uri: [`https://rss.csdn.net/${username}/rss/map`, `https://blog.csdn.net/${username}/rss/list`],
|
|
14
|
+
hint: require_utils.composeHint("csdn:blog")
|
|
15
|
+
}];
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.csdnHandler = csdnHandler;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/csdn.ts
|
|
3
|
+
const hosts = ["blog.csdn.net"];
|
|
4
|
+
const csdnHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isHostOf(url, hosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { pathname } = new URL(url);
|
|
10
|
+
const username = pathname.match(/^\/([^/]+)/)?.[1];
|
|
11
|
+
if (!username) return [];
|
|
12
|
+
return [{
|
|
13
|
+
uri: [`https://rss.csdn.net/${username}/rss/map`, `https://blog.csdn.net/${username}/rss/list`],
|
|
14
|
+
hint: composeHint("csdn:blog")
|
|
15
|
+
}];
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { csdnHandler };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const require_utils = require(
|
|
2
|
-
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
2
|
//#region src/feeds/platform/handlers/dailymotion.ts
|
|
4
3
|
const hosts = ["dailymotion.com", "www.dailymotion.com"];
|
|
5
4
|
const userPathRegex = /^\/([a-zA-Z0-9_-]+)$/;
|
|
@@ -52,15 +51,20 @@ const dailymotionHandler = {
|
|
|
52
51
|
resolve: (url) => {
|
|
53
52
|
const { pathname } = new URL(url);
|
|
54
53
|
const playlistMatch = pathname.match(playlistPathRegex);
|
|
55
|
-
if (playlistMatch?.[1]) return [
|
|
54
|
+
if (playlistMatch?.[1]) return [{
|
|
55
|
+
uri: `https://www.dailymotion.com/rss/playlist/${playlistMatch[1]}`,
|
|
56
|
+
hint: require_utils.composeHint("dailymotion:playlist")
|
|
57
|
+
}];
|
|
56
58
|
const userMatch = pathname.match(userPathRegex);
|
|
57
59
|
if (userMatch?.[1]) {
|
|
58
60
|
const username = userMatch[1];
|
|
59
|
-
if (!require_utils.isAnyOf(username, excludedPaths)) return [
|
|
61
|
+
if (!require_utils.isAnyOf(username, excludedPaths)) return [{
|
|
62
|
+
uri: `https://www.dailymotion.com/rss/${username}`,
|
|
63
|
+
hint: require_utils.composeHint("dailymotion:videos")
|
|
64
|
+
}];
|
|
60
65
|
}
|
|
61
66
|
return [];
|
|
62
67
|
}
|
|
63
68
|
};
|
|
64
|
-
|
|
65
69
|
//#endregion
|
|
66
|
-
exports.dailymotionHandler = dailymotionHandler;
|
|
70
|
+
exports.dailymotionHandler = dailymotionHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
3
2
|
//#region src/feeds/platform/handlers/dailymotion.ts
|
|
4
3
|
const hosts = ["dailymotion.com", "www.dailymotion.com"];
|
|
5
4
|
const userPathRegex = /^\/([a-zA-Z0-9_-]+)$/;
|
|
@@ -52,15 +51,20 @@ const dailymotionHandler = {
|
|
|
52
51
|
resolve: (url) => {
|
|
53
52
|
const { pathname } = new URL(url);
|
|
54
53
|
const playlistMatch = pathname.match(playlistPathRegex);
|
|
55
|
-
if (playlistMatch?.[1]) return [
|
|
54
|
+
if (playlistMatch?.[1]) return [{
|
|
55
|
+
uri: `https://www.dailymotion.com/rss/playlist/${playlistMatch[1]}`,
|
|
56
|
+
hint: composeHint("dailymotion:playlist")
|
|
57
|
+
}];
|
|
56
58
|
const userMatch = pathname.match(userPathRegex);
|
|
57
59
|
if (userMatch?.[1]) {
|
|
58
60
|
const username = userMatch[1];
|
|
59
|
-
if (!isAnyOf(username, excludedPaths)) return [
|
|
61
|
+
if (!isAnyOf(username, excludedPaths)) return [{
|
|
62
|
+
uri: `https://www.dailymotion.com/rss/${username}`,
|
|
63
|
+
hint: composeHint("dailymotion:videos")
|
|
64
|
+
}];
|
|
60
65
|
}
|
|
61
66
|
return [];
|
|
62
67
|
}
|
|
63
68
|
};
|
|
64
|
-
|
|
65
69
|
//#endregion
|
|
66
|
-
export { dailymotionHandler };
|
|
70
|
+
export { dailymotionHandler };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const require_utils = require(
|
|
2
|
-
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
2
|
//#region src/feeds/platform/handlers/deviantart.ts
|
|
4
3
|
const hosts = ["deviantart.com", "www.deviantart.com"];
|
|
5
4
|
const feedBaseUrl = "https://backend.deviantart.com/rss.xml";
|
|
@@ -26,25 +25,38 @@ const deviantartHandler = {
|
|
|
26
25
|
const tagMatch = pathname.match(/^\/tag\/([^/]+)/);
|
|
27
26
|
if (tagMatch?.[1]) {
|
|
28
27
|
const tag = tagMatch[1];
|
|
29
|
-
return [
|
|
28
|
+
return [{
|
|
29
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(`tag:${tag}`)}`,
|
|
30
|
+
hint: require_utils.composeHint("deviantart:tag")
|
|
31
|
+
}];
|
|
30
32
|
}
|
|
31
33
|
const favMatch = pathname.match(/^\/([a-zA-Z0-9_-]+)\/favourites\/?$/);
|
|
32
34
|
if (favMatch?.[1]) {
|
|
33
35
|
const username = favMatch[1];
|
|
34
|
-
if (!require_utils.isAnyOf(username, excludedPaths)) return [
|
|
36
|
+
if (!require_utils.isAnyOf(username, excludedPaths)) return [{
|
|
37
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(`favby:${username}`)}`,
|
|
38
|
+
hint: require_utils.composeHint("deviantart:favorites")
|
|
39
|
+
}];
|
|
35
40
|
}
|
|
36
41
|
const folderMatch = pathname.match(/^\/([a-zA-Z0-9_-]+)\/gallery\/(\d+)(?:\/|$)/);
|
|
37
42
|
if (folderMatch?.[1] && folderMatch?.[2]) {
|
|
38
43
|
const username = folderMatch[1];
|
|
39
44
|
const folderId = folderMatch[2];
|
|
40
|
-
if (!require_utils.isAnyOf(username, excludedPaths)) return [
|
|
45
|
+
if (!require_utils.isAnyOf(username, excludedPaths)) return [{
|
|
46
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(`gallery:${username}/${folderId}`)}`,
|
|
47
|
+
hint: require_utils.composeHint("deviantart:gallery")
|
|
48
|
+
}];
|
|
41
49
|
}
|
|
42
50
|
const username = pathname.match(/^\/([a-zA-Z0-9_-]+)(?:\/gallery(?:\/all)?)?(?:\/|$)/)?.[1];
|
|
43
51
|
if (!username || require_utils.isAnyOf(username, excludedPaths)) return [];
|
|
44
52
|
const query = `by:${username} sort:time meta:all`;
|
|
45
|
-
return [
|
|
53
|
+
return [{
|
|
54
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(query)}`,
|
|
55
|
+
hint: require_utils.composeHint("deviantart:deviations")
|
|
56
|
+
}];
|
|
46
57
|
}
|
|
47
58
|
};
|
|
48
|
-
|
|
49
59
|
//#endregion
|
|
50
|
-
exports.deviantartHandler = deviantartHandler;
|
|
60
|
+
exports.deviantartHandler = deviantartHandler;
|
|
61
|
+
exports.excludedPaths = excludedPaths;
|
|
62
|
+
exports.hosts = hosts;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
3
2
|
//#region src/feeds/platform/handlers/deviantart.ts
|
|
4
3
|
const hosts = ["deviantart.com", "www.deviantart.com"];
|
|
5
4
|
const feedBaseUrl = "https://backend.deviantart.com/rss.xml";
|
|
@@ -26,25 +25,36 @@ const deviantartHandler = {
|
|
|
26
25
|
const tagMatch = pathname.match(/^\/tag\/([^/]+)/);
|
|
27
26
|
if (tagMatch?.[1]) {
|
|
28
27
|
const tag = tagMatch[1];
|
|
29
|
-
return [
|
|
28
|
+
return [{
|
|
29
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(`tag:${tag}`)}`,
|
|
30
|
+
hint: composeHint("deviantart:tag")
|
|
31
|
+
}];
|
|
30
32
|
}
|
|
31
33
|
const favMatch = pathname.match(/^\/([a-zA-Z0-9_-]+)\/favourites\/?$/);
|
|
32
34
|
if (favMatch?.[1]) {
|
|
33
35
|
const username = favMatch[1];
|
|
34
|
-
if (!isAnyOf(username, excludedPaths)) return [
|
|
36
|
+
if (!isAnyOf(username, excludedPaths)) return [{
|
|
37
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(`favby:${username}`)}`,
|
|
38
|
+
hint: composeHint("deviantart:favorites")
|
|
39
|
+
}];
|
|
35
40
|
}
|
|
36
41
|
const folderMatch = pathname.match(/^\/([a-zA-Z0-9_-]+)\/gallery\/(\d+)(?:\/|$)/);
|
|
37
42
|
if (folderMatch?.[1] && folderMatch?.[2]) {
|
|
38
43
|
const username = folderMatch[1];
|
|
39
44
|
const folderId = folderMatch[2];
|
|
40
|
-
if (!isAnyOf(username, excludedPaths)) return [
|
|
45
|
+
if (!isAnyOf(username, excludedPaths)) return [{
|
|
46
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(`gallery:${username}/${folderId}`)}`,
|
|
47
|
+
hint: composeHint("deviantart:gallery")
|
|
48
|
+
}];
|
|
41
49
|
}
|
|
42
50
|
const username = pathname.match(/^\/([a-zA-Z0-9_-]+)(?:\/gallery(?:\/all)?)?(?:\/|$)/)?.[1];
|
|
43
51
|
if (!username || isAnyOf(username, excludedPaths)) return [];
|
|
44
52
|
const query = `by:${username} sort:time meta:all`;
|
|
45
|
-
return [
|
|
53
|
+
return [{
|
|
54
|
+
uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent(query)}`,
|
|
55
|
+
hint: composeHint("deviantart:deviations")
|
|
56
|
+
}];
|
|
46
57
|
}
|
|
47
58
|
};
|
|
48
|
-
|
|
49
59
|
//#endregion
|
|
50
|
-
export { deviantartHandler };
|
|
60
|
+
export { deviantartHandler, excludedPaths, hosts };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const require_utils = require(
|
|
2
|
-
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
2
|
//#region src/feeds/platform/handlers/devto.ts
|
|
4
3
|
const hosts = ["dev.to", "www.dev.to"];
|
|
5
4
|
const userPathRegex = /^\/([a-zA-Z0-9_]+)\/?$/;
|
|
@@ -32,13 +31,18 @@ const devtoHandler = {
|
|
|
32
31
|
const userMatch = pathname.match(userPathRegex);
|
|
33
32
|
if (userMatch?.[1]) {
|
|
34
33
|
const username = userMatch[1];
|
|
35
|
-
if (!require_utils.isAnyOf(username, excludedPaths)) return [
|
|
34
|
+
if (!require_utils.isAnyOf(username, excludedPaths)) return [{
|
|
35
|
+
uri: `https://dev.to/feed/${username}`,
|
|
36
|
+
hint: require_utils.composeHint("devto:posts")
|
|
37
|
+
}];
|
|
36
38
|
}
|
|
37
39
|
const tagMatch = pathname.match(tagPathRegex);
|
|
38
|
-
if (tagMatch?.[1]) return [
|
|
40
|
+
if (tagMatch?.[1]) return [{
|
|
41
|
+
uri: `https://dev.to/feed/tag/${tagMatch[1]}`,
|
|
42
|
+
hint: require_utils.composeHint("devto:tag")
|
|
43
|
+
}];
|
|
39
44
|
return [];
|
|
40
45
|
}
|
|
41
46
|
};
|
|
42
|
-
|
|
43
47
|
//#endregion
|
|
44
|
-
exports.devtoHandler = devtoHandler;
|
|
48
|
+
exports.devtoHandler = devtoHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
3
2
|
//#region src/feeds/platform/handlers/devto.ts
|
|
4
3
|
const hosts = ["dev.to", "www.dev.to"];
|
|
5
4
|
const userPathRegex = /^\/([a-zA-Z0-9_]+)\/?$/;
|
|
@@ -32,13 +31,18 @@ const devtoHandler = {
|
|
|
32
31
|
const userMatch = pathname.match(userPathRegex);
|
|
33
32
|
if (userMatch?.[1]) {
|
|
34
33
|
const username = userMatch[1];
|
|
35
|
-
if (!isAnyOf(username, excludedPaths)) return [
|
|
34
|
+
if (!isAnyOf(username, excludedPaths)) return [{
|
|
35
|
+
uri: `https://dev.to/feed/${username}`,
|
|
36
|
+
hint: composeHint("devto:posts")
|
|
37
|
+
}];
|
|
36
38
|
}
|
|
37
39
|
const tagMatch = pathname.match(tagPathRegex);
|
|
38
|
-
if (tagMatch?.[1]) return [
|
|
40
|
+
if (tagMatch?.[1]) return [{
|
|
41
|
+
uri: `https://dev.to/feed/tag/${tagMatch[1]}`,
|
|
42
|
+
hint: composeHint("devto:tag")
|
|
43
|
+
}];
|
|
39
44
|
return [];
|
|
40
45
|
}
|
|
41
46
|
};
|
|
42
|
-
|
|
43
47
|
//#endregion
|
|
44
|
-
export { devtoHandler };
|
|
48
|
+
export { devtoHandler };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/douban.ts
|
|
3
|
+
const doubanHandler = {
|
|
4
|
+
match: (url) => {
|
|
5
|
+
return require_utils.isHostOf(url, "douban.com") || require_utils.isSubdomainOf(url, "douban.com");
|
|
6
|
+
},
|
|
7
|
+
resolve: (url) => {
|
|
8
|
+
const { pathname } = new URL(url);
|
|
9
|
+
const userMatch = pathname.match(/^\/people\/([^/]+)/);
|
|
10
|
+
if (userMatch?.[1]) {
|
|
11
|
+
const user = userMatch[1];
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
uri: `https://www.douban.com/feed/people/${user}/interests`,
|
|
15
|
+
hint: require_utils.composeHint("douban:interests")
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
uri: `https://www.douban.com/feed/people/${user}/reviews`,
|
|
19
|
+
hint: require_utils.composeHint("douban:reviews")
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
uri: `https://www.douban.com/feed/people/${user}/notes`,
|
|
23
|
+
hint: require_utils.composeHint("douban:notes")
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
const subjectMatch = pathname.match(/^\/subject\/(\d+)/);
|
|
28
|
+
if (subjectMatch?.[1]) return [{
|
|
29
|
+
uri: `https://www.douban.com/feed/subject/${subjectMatch[1]}/reviews`,
|
|
30
|
+
hint: require_utils.composeHint("douban:subjectReviews")
|
|
31
|
+
}];
|
|
32
|
+
if (pathname === "/" || pathname === "") return [
|
|
33
|
+
{
|
|
34
|
+
uri: "https://www.douban.com/feed/review/book",
|
|
35
|
+
hint: require_utils.composeHint("douban:reviews")
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
uri: "https://www.douban.com/feed/review/movie",
|
|
39
|
+
hint: require_utils.composeHint("douban:reviews")
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
uri: "https://www.douban.com/feed/review/music",
|
|
43
|
+
hint: require_utils.composeHint("douban:reviews")
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
uri: "https://www.douban.com/feed/review/drama",
|
|
47
|
+
hint: require_utils.composeHint("douban:reviews")
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.doubanHandler = doubanHandler;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { composeHint, isHostOf, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/douban.ts
|
|
3
|
+
const doubanHandler = {
|
|
4
|
+
match: (url) => {
|
|
5
|
+
return isHostOf(url, "douban.com") || isSubdomainOf(url, "douban.com");
|
|
6
|
+
},
|
|
7
|
+
resolve: (url) => {
|
|
8
|
+
const { pathname } = new URL(url);
|
|
9
|
+
const userMatch = pathname.match(/^\/people\/([^/]+)/);
|
|
10
|
+
if (userMatch?.[1]) {
|
|
11
|
+
const user = userMatch[1];
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
uri: `https://www.douban.com/feed/people/${user}/interests`,
|
|
15
|
+
hint: composeHint("douban:interests")
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
uri: `https://www.douban.com/feed/people/${user}/reviews`,
|
|
19
|
+
hint: composeHint("douban:reviews")
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
uri: `https://www.douban.com/feed/people/${user}/notes`,
|
|
23
|
+
hint: composeHint("douban:notes")
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
const subjectMatch = pathname.match(/^\/subject\/(\d+)/);
|
|
28
|
+
if (subjectMatch?.[1]) return [{
|
|
29
|
+
uri: `https://www.douban.com/feed/subject/${subjectMatch[1]}/reviews`,
|
|
30
|
+
hint: composeHint("douban:subjectReviews")
|
|
31
|
+
}];
|
|
32
|
+
if (pathname === "/" || pathname === "") return [
|
|
33
|
+
{
|
|
34
|
+
uri: "https://www.douban.com/feed/review/book",
|
|
35
|
+
hint: composeHint("douban:reviews")
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
uri: "https://www.douban.com/feed/review/movie",
|
|
39
|
+
hint: composeHint("douban:reviews")
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
uri: "https://www.douban.com/feed/review/music",
|
|
43
|
+
hint: composeHint("douban:reviews")
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
uri: "https://www.douban.com/feed/review/drama",
|
|
47
|
+
hint: composeHint("douban:reviews")
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { doubanHandler };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const require_utils = require(
|
|
2
|
-
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
2
|
//#region src/feeds/platform/handlers/github.ts
|
|
4
3
|
const hosts = ["github.com", "www.github.com"];
|
|
5
4
|
const excludedPaths = [
|
|
@@ -40,6 +39,7 @@ const excludedPaths = [
|
|
|
40
39
|
"security",
|
|
41
40
|
"sessions",
|
|
42
41
|
"settings",
|
|
42
|
+
"signup",
|
|
43
43
|
"site",
|
|
44
44
|
"sponsors",
|
|
45
45
|
"stars",
|
|
@@ -56,34 +56,55 @@ const githubHandler = {
|
|
|
56
56
|
const { pathname } = new URL(url);
|
|
57
57
|
const uris = [];
|
|
58
58
|
const userMatch = pathname.match(/^\/([^/]+)\/?$/);
|
|
59
|
-
if (userMatch?.[1] && !require_utils.isAnyOf(userMatch[1], excludedPaths)) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
59
|
+
if (userMatch?.[1] && !require_utils.isAnyOf(userMatch[1], excludedPaths)) return [{
|
|
60
|
+
uri: `https://github.com/${userMatch[1]}.atom`,
|
|
61
|
+
hint: require_utils.composeHint("github:activity")
|
|
62
|
+
}];
|
|
64
63
|
const repoMatch = pathname.match(/^\/([^/]+)\/([^/]+)/);
|
|
65
64
|
const owner = repoMatch?.[1];
|
|
66
65
|
const repo = repoMatch?.[2];
|
|
67
66
|
if (!owner || !repo || require_utils.isAnyOf(owner, excludedPaths)) return [];
|
|
68
|
-
uris.push(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
uris.push({
|
|
68
|
+
uri: `https://github.com/${owner}/${repo}/releases.atom`,
|
|
69
|
+
hint: require_utils.composeHint("github:releases")
|
|
70
|
+
});
|
|
71
|
+
uris.push({
|
|
72
|
+
uri: `https://github.com/${owner}/${repo}/commits.atom`,
|
|
73
|
+
hint: require_utils.composeHint("github:commits")
|
|
74
|
+
});
|
|
75
|
+
uris.push({
|
|
76
|
+
uri: `https://github.com/${owner}/${repo}/tags.atom`,
|
|
77
|
+
hint: require_utils.composeHint("github:tags")
|
|
78
|
+
});
|
|
79
|
+
if (/\/wiki(\/|$)/.test(pathname)) uris.push({
|
|
80
|
+
uri: `https://github.com/${owner}/${repo}/wiki.atom`,
|
|
81
|
+
hint: require_utils.composeHint("github:wiki")
|
|
82
|
+
});
|
|
83
|
+
if (/\/discussions(\/|$)/.test(pathname)) uris.push({
|
|
84
|
+
uri: `https://github.com/${owner}/${repo}/discussions.atom`,
|
|
85
|
+
hint: require_utils.composeHint("github:discussions")
|
|
86
|
+
});
|
|
73
87
|
const branchMatch = pathname.match(/^\/[^/]+\/[^/]+\/tree\/([^/]+)\/?$/);
|
|
74
88
|
if (branchMatch?.[1]) {
|
|
75
89
|
const branch = branchMatch[1];
|
|
76
|
-
uris.push(
|
|
90
|
+
uris.push({
|
|
91
|
+
uri: `https://github.com/${owner}/${repo}/commits/${branch}.atom`,
|
|
92
|
+
hint: require_utils.composeHint("github:branch-commits")
|
|
93
|
+
});
|
|
77
94
|
}
|
|
78
95
|
const fileMatch = pathname.match(/^\/[^/]+\/[^/]+\/(?:blob|commits)\/([^/]+)\/(.+)/);
|
|
79
96
|
if (fileMatch?.[1] && fileMatch?.[2]) {
|
|
80
97
|
const branch = fileMatch[1];
|
|
81
98
|
const filePath = fileMatch[2];
|
|
82
|
-
uris.push(
|
|
99
|
+
uris.push({
|
|
100
|
+
uri: `https://github.com/${owner}/${repo}/commits/${branch}/${filePath}.atom`,
|
|
101
|
+
hint: require_utils.composeHint("github:file-history")
|
|
102
|
+
});
|
|
83
103
|
}
|
|
84
104
|
return uris;
|
|
85
105
|
}
|
|
86
106
|
};
|
|
87
|
-
|
|
88
107
|
//#endregion
|
|
89
|
-
exports.
|
|
108
|
+
exports.excludedPaths = excludedPaths;
|
|
109
|
+
exports.githubHandler = githubHandler;
|
|
110
|
+
exports.hosts = hosts;
|