feedscout 1.5.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 +24 -16
- package/dist/common/discover/index.js +20 -12
- package/dist/common/discover/utils.cjs +19 -9
- package/dist/common/discover/utils.js +18 -8
- package/dist/common/locales.cjs +59 -15
- package/dist/common/locales.js +49 -4
- package/dist/common/types.cjs +2 -3
- package/dist/common/types.d.cts +11 -6
- package/dist/common/types.d.ts +11 -6
- package/dist/common/types.js +2 -2
- 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.js +1 -3
- package/dist/common/uris/guess/utils.cjs +1 -3
- package/dist/common/uris/guess/utils.js +1 -2
- 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 +15 -12
- package/dist/common/uris/index.js +8 -5
- 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 +3 -3
- package/dist/common/uris/platform/types.d.ts +3 -3
- package/dist/common/utils.cjs +20 -9
- package/dist/common/utils.d.cts +2 -2
- package/dist/common/utils.d.ts +2 -2
- package/dist/common/utils.js +18 -8
- 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 +55 -25
- package/dist/feeds/defaults.js +40 -10
- 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 +2 -4
- package/dist/feeds/platform/handlers/behance.js +1 -3
- package/dist/feeds/platform/handlers/blogspot.cjs +7 -6
- package/dist/feeds/platform/handlers/blogspot.js +6 -5
- package/dist/feeds/platform/handlers/bluesky.cjs +3 -5
- package/dist/feeds/platform/handlers/bluesky.js +2 -4
- 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 +2 -4
- package/dist/feeds/platform/handlers/dailymotion.js +1 -3
- package/dist/feeds/platform/handlers/deviantart.cjs +4 -4
- package/dist/feeds/platform/handlers/deviantart.js +1 -3
- package/dist/feeds/platform/handlers/devto.cjs +2 -4
- package/dist/feeds/platform/handlers/devto.js +1 -3
- 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 +5 -4
- package/dist/feeds/platform/handlers/github.js +2 -3
- package/dist/feeds/platform/handlers/githubGist.cjs +4 -4
- package/dist/feeds/platform/handlers/githubGist.js +1 -3
- package/dist/feeds/platform/handlers/gitlab.cjs +2 -4
- package/dist/feeds/platform/handlers/gitlab.js +1 -3
- 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 +2 -4
- package/dist/feeds/platform/handlers/kickstarter.js +1 -3
- 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 +3 -4
- package/dist/feeds/platform/handlers/lobsters.js +1 -3
- 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 +2 -4
- package/dist/feeds/platform/handlers/medium.js +1 -3
- 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 +2 -15
- package/dist/feeds/platform/handlers/pinterest.js +1 -14
- package/dist/feeds/platform/handlers/producthunt.cjs +2 -4
- package/dist/feeds/platform/handlers/producthunt.js +1 -3
- package/dist/feeds/platform/handlers/reddit.cjs +3 -4
- package/dist/feeds/platform/handlers/reddit.js +1 -3
- package/dist/feeds/platform/handlers/soundcloud.cjs +2 -4
- package/dist/feeds/platform/handlers/soundcloud.js +1 -3
- 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 +2 -4
- package/dist/feeds/platform/handlers/substack.js +1 -3
- package/dist/feeds/platform/handlers/tumblr.cjs +5 -5
- package/dist/feeds/platform/handlers/tumblr.js +3 -4
- 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 +5 -7
- package/dist/feeds/platform/handlers/wordpress.js +4 -6
- package/dist/feeds/platform/handlers/wpengine.cjs +4 -7
- package/dist/feeds/platform/handlers/wpengine.js +2 -4
- 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 +19 -8
- package/dist/feeds/platform/handlers/youtube.js +18 -7
- 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
|
@@ -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/pinterest.ts
|
|
4
3
|
const hosts = [
|
|
5
4
|
"pinterest.com",
|
|
@@ -35,23 +34,11 @@ const pinterestHandler = {
|
|
|
35
34
|
if (pathSegments.length === 0) return [];
|
|
36
35
|
const username = pathSegments[0];
|
|
37
36
|
if (require_utils.isAnyOf(username, excludedPaths)) return [];
|
|
38
|
-
if (pathSegments.length >= 2) {
|
|
39
|
-
const boardname = pathSegments[1];
|
|
40
|
-
if (boardname.startsWith("_") || boardname === "pins" || boardname === "boards") return [{
|
|
41
|
-
uri: `https://www.pinterest.com/${username}/feed.rss`,
|
|
42
|
-
hint: require_utils.composeHint("pinterest:pins")
|
|
43
|
-
}];
|
|
44
|
-
return [{
|
|
45
|
-
uri: `https://www.pinterest.com/${username}/${boardname}.rss`,
|
|
46
|
-
hint: require_utils.composeHint("pinterest:board")
|
|
47
|
-
}];
|
|
48
|
-
}
|
|
49
37
|
return [{
|
|
50
38
|
uri: `https://www.pinterest.com/${username}/feed.rss`,
|
|
51
39
|
hint: require_utils.composeHint("pinterest:pins")
|
|
52
40
|
}];
|
|
53
41
|
}
|
|
54
42
|
};
|
|
55
|
-
|
|
56
43
|
//#endregion
|
|
57
|
-
exports.pinterestHandler = pinterestHandler;
|
|
44
|
+
exports.pinterestHandler = pinterestHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/platform/handlers/pinterest.ts
|
|
4
3
|
const hosts = [
|
|
5
4
|
"pinterest.com",
|
|
@@ -35,23 +34,11 @@ const pinterestHandler = {
|
|
|
35
34
|
if (pathSegments.length === 0) return [];
|
|
36
35
|
const username = pathSegments[0];
|
|
37
36
|
if (isAnyOf(username, excludedPaths)) return [];
|
|
38
|
-
if (pathSegments.length >= 2) {
|
|
39
|
-
const boardname = pathSegments[1];
|
|
40
|
-
if (boardname.startsWith("_") || boardname === "pins" || boardname === "boards") return [{
|
|
41
|
-
uri: `https://www.pinterest.com/${username}/feed.rss`,
|
|
42
|
-
hint: composeHint("pinterest:pins")
|
|
43
|
-
}];
|
|
44
|
-
return [{
|
|
45
|
-
uri: `https://www.pinterest.com/${username}/${boardname}.rss`,
|
|
46
|
-
hint: composeHint("pinterest:board")
|
|
47
|
-
}];
|
|
48
|
-
}
|
|
49
37
|
return [{
|
|
50
38
|
uri: `https://www.pinterest.com/${username}/feed.rss`,
|
|
51
39
|
hint: composeHint("pinterest:pins")
|
|
52
40
|
}];
|
|
53
41
|
}
|
|
54
42
|
};
|
|
55
|
-
|
|
56
43
|
//#endregion
|
|
57
|
-
export { pinterestHandler };
|
|
44
|
+
export { pinterestHandler };
|
|
@@ -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/producthunt.ts
|
|
4
3
|
const hosts = ["producthunt.com", "www.producthunt.com"];
|
|
5
4
|
const topicPathRegex = /^\/topics\/([a-zA-Z0-9_-]+)/;
|
|
@@ -26,6 +25,5 @@ const producthuntHandler = {
|
|
|
26
25
|
}];
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
//#endregion
|
|
31
|
-
exports.producthuntHandler = producthuntHandler;
|
|
29
|
+
exports.producthuntHandler = producthuntHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/platform/handlers/producthunt.ts
|
|
4
3
|
const hosts = ["producthunt.com", "www.producthunt.com"];
|
|
5
4
|
const topicPathRegex = /^\/topics\/([a-zA-Z0-9_-]+)/;
|
|
@@ -26,6 +25,5 @@ const producthuntHandler = {
|
|
|
26
25
|
}];
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
//#endregion
|
|
31
|
-
export { producthuntHandler };
|
|
29
|
+
export { producthuntHandler };
|
|
@@ -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/reddit.ts
|
|
4
3
|
const hosts = [
|
|
5
4
|
"reddit.com",
|
|
@@ -66,6 +65,6 @@ const redditHandler = {
|
|
|
66
65
|
return [];
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
|
-
|
|
70
68
|
//#endregion
|
|
71
|
-
exports.
|
|
69
|
+
exports.hosts = hosts;
|
|
70
|
+
exports.redditHandler = redditHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/platform/handlers/reddit.ts
|
|
4
3
|
const hosts = [
|
|
5
4
|
"reddit.com",
|
|
@@ -66,6 +65,5 @@ const redditHandler = {
|
|
|
66
65
|
return [];
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
|
-
|
|
70
68
|
//#endregion
|
|
71
|
-
export { redditHandler };
|
|
69
|
+
export { hosts, redditHandler };
|
|
@@ -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/soundcloud.ts
|
|
4
3
|
const hosts = [
|
|
5
4
|
"soundcloud.com",
|
|
@@ -35,6 +34,5 @@ const soundcloudHandler = {
|
|
|
35
34
|
}];
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
|
-
|
|
39
37
|
//#endregion
|
|
40
|
-
exports.soundcloudHandler = soundcloudHandler;
|
|
38
|
+
exports.soundcloudHandler = soundcloudHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/platform/handlers/soundcloud.ts
|
|
4
3
|
const hosts = [
|
|
5
4
|
"soundcloud.com",
|
|
@@ -35,6 +34,5 @@ const soundcloudHandler = {
|
|
|
35
34
|
}];
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
|
-
|
|
39
37
|
//#endregion
|
|
40
|
-
export { soundcloudHandler };
|
|
38
|
+
export { soundcloudHandler };
|
|
@@ -0,0 +1,20 @@
|
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/sourceforge.ts
|
|
3
|
+
const hosts = ["sourceforge.net", "www.sourceforge.net"];
|
|
4
|
+
const sourceforgeHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return 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: composeHint("sourceforge:activity")
|
|
14
|
+
}];
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { hosts, sourceforgeHandler };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/stackExchange.ts
|
|
3
|
+
const domains = [
|
|
4
|
+
"stackoverflow.com",
|
|
5
|
+
"serverfault.com",
|
|
6
|
+
"superuser.com",
|
|
7
|
+
"askubuntu.com",
|
|
8
|
+
"stackapps.com",
|
|
9
|
+
"mathoverflow.net",
|
|
10
|
+
"stackexchange.com"
|
|
11
|
+
];
|
|
12
|
+
const stackExchangeHandler = {
|
|
13
|
+
match: (url) => {
|
|
14
|
+
return require_utils.isHostOf(url, domains) || require_utils.isSubdomainOf(url, domains);
|
|
15
|
+
},
|
|
16
|
+
resolve: (url) => {
|
|
17
|
+
const { origin, pathname } = new URL(url);
|
|
18
|
+
const tagMatch = pathname.match(/^\/questions\/tagged\/([\w.+-]+)/);
|
|
19
|
+
if (tagMatch?.[1]) return [{
|
|
20
|
+
uri: `${origin}/feeds/tag/${tagMatch[1]}`,
|
|
21
|
+
hint: require_utils.composeHint("stackexchange:tag")
|
|
22
|
+
}];
|
|
23
|
+
const questionMatch = pathname.match(/^\/questions\/(\d+)/);
|
|
24
|
+
if (questionMatch?.[1]) return [{
|
|
25
|
+
uri: `${origin}/feeds/question/${questionMatch[1]}`,
|
|
26
|
+
hint: require_utils.composeHint("stackexchange:question")
|
|
27
|
+
}];
|
|
28
|
+
const userMatch = pathname.match(/^\/users\/(\d+)/);
|
|
29
|
+
if (userMatch?.[1]) return [{
|
|
30
|
+
uri: `${origin}/feeds/user/${userMatch[1]}`,
|
|
31
|
+
hint: require_utils.composeHint("stackexchange:user")
|
|
32
|
+
}];
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.stackExchangeHandler = stackExchangeHandler;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { composeHint, isHostOf, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/stackExchange.ts
|
|
3
|
+
const domains = [
|
|
4
|
+
"stackoverflow.com",
|
|
5
|
+
"serverfault.com",
|
|
6
|
+
"superuser.com",
|
|
7
|
+
"askubuntu.com",
|
|
8
|
+
"stackapps.com",
|
|
9
|
+
"mathoverflow.net",
|
|
10
|
+
"stackexchange.com"
|
|
11
|
+
];
|
|
12
|
+
const stackExchangeHandler = {
|
|
13
|
+
match: (url) => {
|
|
14
|
+
return isHostOf(url, domains) || isSubdomainOf(url, domains);
|
|
15
|
+
},
|
|
16
|
+
resolve: (url) => {
|
|
17
|
+
const { origin, pathname } = new URL(url);
|
|
18
|
+
const tagMatch = pathname.match(/^\/questions\/tagged\/([\w.+-]+)/);
|
|
19
|
+
if (tagMatch?.[1]) return [{
|
|
20
|
+
uri: `${origin}/feeds/tag/${tagMatch[1]}`,
|
|
21
|
+
hint: composeHint("stackexchange:tag")
|
|
22
|
+
}];
|
|
23
|
+
const questionMatch = pathname.match(/^\/questions\/(\d+)/);
|
|
24
|
+
if (questionMatch?.[1]) return [{
|
|
25
|
+
uri: `${origin}/feeds/question/${questionMatch[1]}`,
|
|
26
|
+
hint: composeHint("stackexchange:question")
|
|
27
|
+
}];
|
|
28
|
+
const userMatch = pathname.match(/^\/users\/(\d+)/);
|
|
29
|
+
if (userMatch?.[1]) return [{
|
|
30
|
+
uri: `${origin}/feeds/user/${userMatch[1]}`,
|
|
31
|
+
hint: composeHint("stackexchange:user")
|
|
32
|
+
}];
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { stackExchangeHandler };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/steam.ts
|
|
3
|
+
const hosts = ["store.steampowered.com", "steamcommunity.com"];
|
|
4
|
+
const steamHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return require_utils.isHostOf(url, hosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { hostname, pathname } = new URL(url);
|
|
10
|
+
const appMatch = pathname.match(/^\/(?:news\/)?app\/(\d+)/);
|
|
11
|
+
if (appMatch?.[1]) return [{
|
|
12
|
+
uri: `https://store.steampowered.com/feeds/news/app/${appMatch[1]}/`,
|
|
13
|
+
hint: require_utils.composeHint("steam:news")
|
|
14
|
+
}];
|
|
15
|
+
if (hostname === "steamcommunity.com") {
|
|
16
|
+
const groupMatch = pathname.match(/^\/groups\/([^/]+)/);
|
|
17
|
+
if (groupMatch?.[1]) return [{
|
|
18
|
+
uri: `https://steamcommunity.com/groups/${groupMatch[1]}/rss`,
|
|
19
|
+
hint: require_utils.composeHint("steam:group")
|
|
20
|
+
}];
|
|
21
|
+
}
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.steamHandler = steamHandler;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/steam.ts
|
|
3
|
+
const hosts = ["store.steampowered.com", "steamcommunity.com"];
|
|
4
|
+
const steamHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isHostOf(url, hosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { hostname, pathname } = new URL(url);
|
|
10
|
+
const appMatch = pathname.match(/^\/(?:news\/)?app\/(\d+)/);
|
|
11
|
+
if (appMatch?.[1]) return [{
|
|
12
|
+
uri: `https://store.steampowered.com/feeds/news/app/${appMatch[1]}/`,
|
|
13
|
+
hint: composeHint("steam:news")
|
|
14
|
+
}];
|
|
15
|
+
if (hostname === "steamcommunity.com") {
|
|
16
|
+
const groupMatch = pathname.match(/^\/groups\/([^/]+)/);
|
|
17
|
+
if (groupMatch?.[1]) return [{
|
|
18
|
+
uri: `https://steamcommunity.com/groups/${groupMatch[1]}/rss`,
|
|
19
|
+
hint: composeHint("steam:group")
|
|
20
|
+
}];
|
|
21
|
+
}
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { steamHandler };
|
|
@@ -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/substack.ts
|
|
4
3
|
const substackHandler = {
|
|
5
4
|
match: (url) => {
|
|
@@ -13,6 +12,5 @@ const substackHandler = {
|
|
|
13
12
|
}];
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
|
-
|
|
17
15
|
//#endregion
|
|
18
|
-
exports.substackHandler = substackHandler;
|
|
16
|
+
exports.substackHandler = substackHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/platform/handlers/substack.ts
|
|
4
3
|
const substackHandler = {
|
|
5
4
|
match: (url) => {
|
|
@@ -13,6 +12,5 @@ const substackHandler = {
|
|
|
13
12
|
}];
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
|
-
|
|
17
15
|
//#endregion
|
|
18
|
-
export { substackHandler };
|
|
16
|
+
export { substackHandler };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_utils = require(
|
|
2
|
-
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
2
|
//#region src/feeds/platform/handlers/tumblr.ts
|
|
3
|
+
const domains = ["tumblr.com"];
|
|
4
4
|
const tagPathRegex = /^\/tagged\/([^/]+)/;
|
|
5
5
|
const tumblrHandler = {
|
|
6
6
|
match: (url) => {
|
|
7
|
-
return require_utils.isSubdomainOf(url,
|
|
7
|
+
return require_utils.isSubdomainOf(url, domains);
|
|
8
8
|
},
|
|
9
9
|
resolve: (url) => {
|
|
10
10
|
const { origin, pathname } = new URL(url);
|
|
@@ -19,6 +19,6 @@ const tumblrHandler = {
|
|
|
19
19
|
}];
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
|
|
23
22
|
//#endregion
|
|
24
|
-
exports.
|
|
23
|
+
exports.domains = domains;
|
|
24
|
+
exports.tumblrHandler = tumblrHandler;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/platform/handlers/tumblr.ts
|
|
3
|
+
const domains = ["tumblr.com"];
|
|
4
4
|
const tagPathRegex = /^\/tagged\/([^/]+)/;
|
|
5
5
|
const tumblrHandler = {
|
|
6
6
|
match: (url) => {
|
|
7
|
-
return isSubdomainOf(url,
|
|
7
|
+
return isSubdomainOf(url, domains);
|
|
8
8
|
},
|
|
9
9
|
resolve: (url) => {
|
|
10
10
|
const { origin, pathname } = new URL(url);
|
|
@@ -19,6 +19,5 @@ const tumblrHandler = {
|
|
|
19
19
|
}];
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
|
|
23
22
|
//#endregion
|
|
24
|
-
export { tumblrHandler };
|
|
23
|
+
export { domains, tumblrHandler };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/v2ex.ts
|
|
3
|
+
const hosts = ["www.v2ex.com", "v2ex.com"];
|
|
4
|
+
const v2exHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return require_utils.isHostOf(url, hosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { pathname, searchParams } = new URL(url);
|
|
10
|
+
const nodeMatch = pathname.match(/^\/go\/([^/]+)/);
|
|
11
|
+
if (nodeMatch?.[1]) return [{
|
|
12
|
+
uri: `https://www.v2ex.com/feed/${nodeMatch[1]}.xml`,
|
|
13
|
+
hint: require_utils.composeHint("v2ex:node")
|
|
14
|
+
}];
|
|
15
|
+
const memberMatch = pathname.match(/^\/member\/([^/]+)/);
|
|
16
|
+
if (memberMatch?.[1]) return [{
|
|
17
|
+
uri: `https://www.v2ex.com/feed/member/${memberMatch[1]}.xml`,
|
|
18
|
+
hint: require_utils.composeHint("v2ex:member")
|
|
19
|
+
}];
|
|
20
|
+
const tab = searchParams.get("tab");
|
|
21
|
+
if (tab) return [{
|
|
22
|
+
uri: `https://www.v2ex.com/feed/tab/${tab}.xml`,
|
|
23
|
+
hint: require_utils.composeHint("v2ex:tab")
|
|
24
|
+
}];
|
|
25
|
+
if (pathname === "/" || pathname === "") return [{
|
|
26
|
+
uri: "https://www.v2ex.com/index.xml",
|
|
27
|
+
hint: require_utils.composeHint("v2ex:index")
|
|
28
|
+
}];
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.v2exHandler = v2exHandler;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/v2ex.ts
|
|
3
|
+
const hosts = ["www.v2ex.com", "v2ex.com"];
|
|
4
|
+
const v2exHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isHostOf(url, hosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { pathname, searchParams } = new URL(url);
|
|
10
|
+
const nodeMatch = pathname.match(/^\/go\/([^/]+)/);
|
|
11
|
+
if (nodeMatch?.[1]) return [{
|
|
12
|
+
uri: `https://www.v2ex.com/feed/${nodeMatch[1]}.xml`,
|
|
13
|
+
hint: composeHint("v2ex:node")
|
|
14
|
+
}];
|
|
15
|
+
const memberMatch = pathname.match(/^\/member\/([^/]+)/);
|
|
16
|
+
if (memberMatch?.[1]) return [{
|
|
17
|
+
uri: `https://www.v2ex.com/feed/member/${memberMatch[1]}.xml`,
|
|
18
|
+
hint: composeHint("v2ex:member")
|
|
19
|
+
}];
|
|
20
|
+
const tab = searchParams.get("tab");
|
|
21
|
+
if (tab) return [{
|
|
22
|
+
uri: `https://www.v2ex.com/feed/tab/${tab}.xml`,
|
|
23
|
+
hint: composeHint("v2ex:tab")
|
|
24
|
+
}];
|
|
25
|
+
if (pathname === "/" || pathname === "") return [{
|
|
26
|
+
uri: "https://www.v2ex.com/index.xml",
|
|
27
|
+
hint: composeHint("v2ex:index")
|
|
28
|
+
}];
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { v2exHandler };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
//#region src/feeds/platform/handlers/vimeo.ts
|
|
3
|
+
const hosts = ["vimeo.com", "www.vimeo.com"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"blog",
|
|
7
|
+
"business",
|
|
8
|
+
"careers",
|
|
9
|
+
"categories",
|
|
10
|
+
"channels",
|
|
11
|
+
"create",
|
|
12
|
+
"enterprise",
|
|
13
|
+
"explore",
|
|
14
|
+
"features",
|
|
15
|
+
"for-hire",
|
|
16
|
+
"groups",
|
|
17
|
+
"help",
|
|
18
|
+
"join",
|
|
19
|
+
"log_in",
|
|
20
|
+
"manage",
|
|
21
|
+
"ondemand",
|
|
22
|
+
"ott",
|
|
23
|
+
"plus",
|
|
24
|
+
"pricing",
|
|
25
|
+
"pro",
|
|
26
|
+
"search",
|
|
27
|
+
"settings",
|
|
28
|
+
"site_map",
|
|
29
|
+
"solutions",
|
|
30
|
+
"stock",
|
|
31
|
+
"upload",
|
|
32
|
+
"upgrade",
|
|
33
|
+
"watch"
|
|
34
|
+
];
|
|
35
|
+
const vimeoHandler = {
|
|
36
|
+
match: (url) => {
|
|
37
|
+
return require_utils.isHostOf(url, hosts);
|
|
38
|
+
},
|
|
39
|
+
resolve: (url) => {
|
|
40
|
+
const { origin, pathname } = new URL(url);
|
|
41
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
42
|
+
if (pathSegments[0] === "channels" && pathSegments[1]) return [{
|
|
43
|
+
uri: `${origin}/channels/${pathSegments[1]}/videos/rss`,
|
|
44
|
+
hint: require_utils.composeHint("vimeo:channel")
|
|
45
|
+
}];
|
|
46
|
+
if (pathSegments[0] === "groups" && pathSegments[1]) return [{
|
|
47
|
+
uri: `${origin}/groups/${pathSegments[1]}/videos/rss`,
|
|
48
|
+
hint: require_utils.composeHint("vimeo:group")
|
|
49
|
+
}];
|
|
50
|
+
if (pathSegments.length >= 1) {
|
|
51
|
+
const user = pathSegments[0];
|
|
52
|
+
if (!require_utils.isAnyOf(user, excludedPaths) && !/^\d+$/.test(user)) {
|
|
53
|
+
const feeds = [{
|
|
54
|
+
uri: `${origin}/${user}/videos/rss`,
|
|
55
|
+
hint: require_utils.composeHint("vimeo:videos")
|
|
56
|
+
}];
|
|
57
|
+
if (pathSegments[1] === "likes") feeds.unshift({
|
|
58
|
+
uri: `${origin}/${user}/likes/rss`,
|
|
59
|
+
hint: require_utils.composeHint("vimeo:likes")
|
|
60
|
+
});
|
|
61
|
+
return feeds;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
exports.vimeoHandler = vimeoHandler;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
//#region src/feeds/platform/handlers/vimeo.ts
|
|
3
|
+
const hosts = ["vimeo.com", "www.vimeo.com"];
|
|
4
|
+
const excludedPaths = [
|
|
5
|
+
"about",
|
|
6
|
+
"blog",
|
|
7
|
+
"business",
|
|
8
|
+
"careers",
|
|
9
|
+
"categories",
|
|
10
|
+
"channels",
|
|
11
|
+
"create",
|
|
12
|
+
"enterprise",
|
|
13
|
+
"explore",
|
|
14
|
+
"features",
|
|
15
|
+
"for-hire",
|
|
16
|
+
"groups",
|
|
17
|
+
"help",
|
|
18
|
+
"join",
|
|
19
|
+
"log_in",
|
|
20
|
+
"manage",
|
|
21
|
+
"ondemand",
|
|
22
|
+
"ott",
|
|
23
|
+
"plus",
|
|
24
|
+
"pricing",
|
|
25
|
+
"pro",
|
|
26
|
+
"search",
|
|
27
|
+
"settings",
|
|
28
|
+
"site_map",
|
|
29
|
+
"solutions",
|
|
30
|
+
"stock",
|
|
31
|
+
"upload",
|
|
32
|
+
"upgrade",
|
|
33
|
+
"watch"
|
|
34
|
+
];
|
|
35
|
+
const vimeoHandler = {
|
|
36
|
+
match: (url) => {
|
|
37
|
+
return isHostOf(url, hosts);
|
|
38
|
+
},
|
|
39
|
+
resolve: (url) => {
|
|
40
|
+
const { origin, pathname } = new URL(url);
|
|
41
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
42
|
+
if (pathSegments[0] === "channels" && pathSegments[1]) return [{
|
|
43
|
+
uri: `${origin}/channels/${pathSegments[1]}/videos/rss`,
|
|
44
|
+
hint: composeHint("vimeo:channel")
|
|
45
|
+
}];
|
|
46
|
+
if (pathSegments[0] === "groups" && pathSegments[1]) return [{
|
|
47
|
+
uri: `${origin}/groups/${pathSegments[1]}/videos/rss`,
|
|
48
|
+
hint: composeHint("vimeo:group")
|
|
49
|
+
}];
|
|
50
|
+
if (pathSegments.length >= 1) {
|
|
51
|
+
const user = pathSegments[0];
|
|
52
|
+
if (!isAnyOf(user, excludedPaths) && !/^\d+$/.test(user)) {
|
|
53
|
+
const feeds = [{
|
|
54
|
+
uri: `${origin}/${user}/videos/rss`,
|
|
55
|
+
hint: composeHint("vimeo:videos")
|
|
56
|
+
}];
|
|
57
|
+
if (pathSegments[1] === "likes") feeds.unshift({
|
|
58
|
+
uri: `${origin}/${user}/likes/rss`,
|
|
59
|
+
hint: composeHint("vimeo:likes")
|
|
60
|
+
});
|
|
61
|
+
return feeds;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { vimeoHandler };
|
|
@@ -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/wordpress.ts
|
|
4
3
|
const categoryPathRegex = /^\/category\/([^/]+)/;
|
|
5
4
|
const tagPathRegex = /^\/tag\/([^/]+)/;
|
|
@@ -13,17 +12,17 @@ const wordpressHandler = {
|
|
|
13
12
|
const uris = [];
|
|
14
13
|
const categoryMatch = pathname.match(categoryPathRegex);
|
|
15
14
|
if (categoryMatch?.[1]) uris.push({
|
|
16
|
-
uri: `${origin}/category/${categoryMatch[1]}/feed/`,
|
|
15
|
+
uri: [`${origin}/category/${categoryMatch[1]}/feed/`, `${origin}/category/${categoryMatch[1]}/?feed=rss`],
|
|
17
16
|
hint: require_utils.composeHint("wordpress:category")
|
|
18
17
|
});
|
|
19
18
|
const tagMatch = pathname.match(tagPathRegex);
|
|
20
19
|
if (tagMatch?.[1]) uris.push({
|
|
21
|
-
uri: `${origin}/tag/${tagMatch[1]}/feed/`,
|
|
20
|
+
uri: [`${origin}/tag/${tagMatch[1]}/feed/`, `${origin}/tag/${tagMatch[1]}/?feed=rss`],
|
|
22
21
|
hint: require_utils.composeHint("wordpress:tag")
|
|
23
22
|
});
|
|
24
23
|
const authorMatch = pathname.match(authorPathRegex);
|
|
25
24
|
if (authorMatch?.[1]) uris.push({
|
|
26
|
-
uri: `${origin}/author/${authorMatch[1]}/feed/`,
|
|
25
|
+
uri: [`${origin}/author/${authorMatch[1]}/feed/`, `${origin}/author/${authorMatch[1]}/?feed=rss`],
|
|
27
26
|
hint: require_utils.composeHint("wordpress:author")
|
|
28
27
|
});
|
|
29
28
|
uris.push({
|
|
@@ -61,6 +60,5 @@ const wordpressHandler = {
|
|
|
61
60
|
return uris;
|
|
62
61
|
}
|
|
63
62
|
};
|
|
64
|
-
|
|
65
63
|
//#endregion
|
|
66
|
-
exports.wordpressHandler = wordpressHandler;
|
|
64
|
+
exports.wordpressHandler = wordpressHandler;
|