feedscout 1.4.0 → 1.5.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/dist/common/discover/index.cjs +45 -14
- package/dist/common/discover/index.js +46 -15
- package/dist/common/discover/utils.cjs +12 -1
- package/dist/common/discover/utils.js +11 -1
- package/dist/common/locales.cjs +75 -0
- package/dist/common/locales.js +70 -1
- package/dist/common/types.cjs +11 -0
- package/dist/common/types.d.cts +15 -2
- package/dist/common/types.d.ts +15 -2
- package/dist/common/types.js +10 -0
- 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/types.d.cts +3 -1
- package/dist/common/uris/guess/types.d.ts +3 -1
- package/dist/common/uris/guess/utils.cjs +4 -1
- 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 +4 -1
- package/dist/common/uris/index.cjs +13 -10
- package/dist/common/uris/index.js +13 -10
- package/dist/common/uris/platform/types.d.cts +3 -1
- package/dist/common/uris/platform/types.d.ts +3 -1
- package/dist/common/utils.cjs +6 -0
- package/dist/common/utils.js +7 -1
- package/dist/feeds/defaults.cjs +12 -13
- package/dist/feeds/defaults.d.cts +2 -2
- package/dist/feeds/defaults.d.ts +2 -2
- package/dist/feeds/defaults.js +12 -13
- package/dist/feeds/platform/handlers/behance.cjs +8 -2
- package/dist/feeds/platform/handlers/behance.js +9 -3
- package/dist/feeds/platform/handlers/blogspot.cjs +13 -3
- package/dist/feeds/platform/handlers/blogspot.js +14 -3
- package/dist/feeds/platform/handlers/bluesky.cjs +4 -1
- package/dist/feeds/platform/handlers/bluesky.js +5 -2
- package/dist/feeds/platform/handlers/dailymotion.cjs +8 -2
- package/dist/feeds/platform/handlers/dailymotion.js +9 -3
- package/dist/feeds/platform/handlers/deviantart.cjs +16 -4
- package/dist/feeds/platform/handlers/deviantart.js +17 -5
- package/dist/feeds/platform/handlers/devto.cjs +8 -2
- package/dist/feeds/platform/handlers/devto.js +9 -3
- package/dist/feeds/platform/handlers/github.cjs +32 -12
- package/dist/feeds/platform/handlers/github.js +33 -13
- package/dist/feeds/platform/handlers/githubGist.cjs +13 -13
- package/dist/feeds/platform/handlers/githubGist.js +14 -14
- package/dist/feeds/platform/handlers/gitlab.cjs +16 -4
- package/dist/feeds/platform/handlers/gitlab.js +17 -5
- package/dist/feeds/platform/handlers/kickstarter.cjs +8 -2
- package/dist/feeds/platform/handlers/kickstarter.js +9 -3
- package/dist/feeds/platform/handlers/lobsters.cjs +32 -8
- package/dist/feeds/platform/handlers/lobsters.js +33 -9
- package/dist/feeds/platform/handlers/medium.cjs +24 -6
- package/dist/feeds/platform/handlers/medium.js +25 -7
- package/dist/feeds/platform/handlers/pinterest.cjs +12 -3
- package/dist/feeds/platform/handlers/pinterest.js +13 -4
- package/dist/feeds/platform/handlers/producthunt.cjs +12 -3
- package/dist/feeds/platform/handlers/producthunt.js +13 -4
- package/dist/feeds/platform/handlers/reddit.cjs +32 -8
- package/dist/feeds/platform/handlers/reddit.js +33 -9
- package/dist/feeds/platform/handlers/soundcloud.cjs +4 -1
- package/dist/feeds/platform/handlers/soundcloud.js +5 -2
- package/dist/feeds/platform/handlers/substack.cjs +4 -1
- package/dist/feeds/platform/handlers/substack.js +5 -2
- package/dist/feeds/platform/handlers/tumblr.cjs +8 -2
- package/dist/feeds/platform/handlers/tumblr.js +9 -3
- package/dist/feeds/platform/handlers/wordpress.cjs +44 -8
- package/dist/feeds/platform/handlers/wordpress.js +45 -9
- package/dist/feeds/platform/handlers/wpengine.cjs +13 -0
- package/dist/feeds/platform/handlers/wpengine.js +13 -0
- package/dist/feeds/platform/handlers/youtube.cjs +20 -9
- package/dist/feeds/platform/handlers/youtube.js +21 -10
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -20,25 +20,49 @@ const redditHandler = {
|
|
|
20
20
|
},
|
|
21
21
|
resolve: (url) => {
|
|
22
22
|
const { pathname } = new URL(url);
|
|
23
|
-
if (pathname.split("/").filter(Boolean).length === 0) return [
|
|
23
|
+
if (pathname.split("/").filter(Boolean).length === 0) return [{
|
|
24
|
+
uri: "https://www.reddit.com/.rss",
|
|
25
|
+
hint: require_utils.composeHint("reddit:posts")
|
|
26
|
+
}];
|
|
24
27
|
const commentsMatch = pathname.match(/^\/r\/([^/]+)\/comments\/([^/]+)/);
|
|
25
|
-
if (commentsMatch?.[1] && commentsMatch?.[2]) return [
|
|
28
|
+
if (commentsMatch?.[1] && commentsMatch?.[2]) return [{
|
|
29
|
+
uri: `https://www.reddit.com/r/${commentsMatch[1]}/comments/${commentsMatch[2]}/.rss`,
|
|
30
|
+
hint: require_utils.composeHint("reddit:post-comments")
|
|
31
|
+
}];
|
|
26
32
|
const subredditMatch = pathname.match(/^\/r\/([^/]+)(?:\/([^/]+))?/);
|
|
27
33
|
if (subredditMatch?.[1]) {
|
|
28
34
|
const subreddit = subredditMatch[1];
|
|
29
35
|
const sort = subredditMatch[2];
|
|
30
36
|
const uris = [];
|
|
31
|
-
if (sort && require_utils.isAnyOf(sort, sortOptions)) uris.push(
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
if (sort && require_utils.isAnyOf(sort, sortOptions)) uris.push({
|
|
38
|
+
uri: `https://www.reddit.com/r/${subreddit}/${sort}/.rss`,
|
|
39
|
+
hint: require_utils.composeHint("reddit:posts")
|
|
40
|
+
});
|
|
41
|
+
else uris.push({
|
|
42
|
+
uri: `https://www.reddit.com/r/${subreddit}/.rss`,
|
|
43
|
+
hint: require_utils.composeHint("reddit:posts")
|
|
44
|
+
});
|
|
45
|
+
uris.push({
|
|
46
|
+
uri: `https://www.reddit.com/r/${subreddit}/comments/.rss`,
|
|
47
|
+
hint: require_utils.composeHint("reddit:comments")
|
|
48
|
+
});
|
|
34
49
|
return uris;
|
|
35
50
|
}
|
|
36
51
|
const multiredditMatch = pathname.match(/^\/user\/([^/]+)\/m\/([^/]+)/);
|
|
37
|
-
if (multiredditMatch?.[1] && multiredditMatch?.[2]) return [
|
|
52
|
+
if (multiredditMatch?.[1] && multiredditMatch?.[2]) return [{
|
|
53
|
+
uri: `https://www.reddit.com/user/${multiredditMatch[1]}/m/${multiredditMatch[2]}/.rss`,
|
|
54
|
+
hint: require_utils.composeHint("reddit:multireddit")
|
|
55
|
+
}];
|
|
38
56
|
const userMatch = pathname.match(/^\/(u|user)\/([^/]+)/);
|
|
39
|
-
if (userMatch?.[2]) return [
|
|
57
|
+
if (userMatch?.[2]) return [{
|
|
58
|
+
uri: `https://www.reddit.com/user/${userMatch[2]}/.rss`,
|
|
59
|
+
hint: require_utils.composeHint("reddit:posts")
|
|
60
|
+
}];
|
|
40
61
|
const domainMatch = pathname.match(/^\/domain\/([^/]+)/);
|
|
41
|
-
if (domainMatch?.[1]) return [
|
|
62
|
+
if (domainMatch?.[1]) return [{
|
|
63
|
+
uri: `https://www.reddit.com/domain/${domainMatch[1]}/.rss`,
|
|
64
|
+
hint: require_utils.composeHint("reddit:posts")
|
|
65
|
+
}];
|
|
42
66
|
return [];
|
|
43
67
|
}
|
|
44
68
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
2
|
|
|
3
3
|
//#region src/feeds/platform/handlers/reddit.ts
|
|
4
4
|
const hosts = [
|
|
@@ -20,25 +20,49 @@ const redditHandler = {
|
|
|
20
20
|
},
|
|
21
21
|
resolve: (url) => {
|
|
22
22
|
const { pathname } = new URL(url);
|
|
23
|
-
if (pathname.split("/").filter(Boolean).length === 0) return [
|
|
23
|
+
if (pathname.split("/").filter(Boolean).length === 0) return [{
|
|
24
|
+
uri: "https://www.reddit.com/.rss",
|
|
25
|
+
hint: composeHint("reddit:posts")
|
|
26
|
+
}];
|
|
24
27
|
const commentsMatch = pathname.match(/^\/r\/([^/]+)\/comments\/([^/]+)/);
|
|
25
|
-
if (commentsMatch?.[1] && commentsMatch?.[2]) return [
|
|
28
|
+
if (commentsMatch?.[1] && commentsMatch?.[2]) return [{
|
|
29
|
+
uri: `https://www.reddit.com/r/${commentsMatch[1]}/comments/${commentsMatch[2]}/.rss`,
|
|
30
|
+
hint: composeHint("reddit:post-comments")
|
|
31
|
+
}];
|
|
26
32
|
const subredditMatch = pathname.match(/^\/r\/([^/]+)(?:\/([^/]+))?/);
|
|
27
33
|
if (subredditMatch?.[1]) {
|
|
28
34
|
const subreddit = subredditMatch[1];
|
|
29
35
|
const sort = subredditMatch[2];
|
|
30
36
|
const uris = [];
|
|
31
|
-
if (sort && isAnyOf(sort, sortOptions)) uris.push(
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
if (sort && isAnyOf(sort, sortOptions)) uris.push({
|
|
38
|
+
uri: `https://www.reddit.com/r/${subreddit}/${sort}/.rss`,
|
|
39
|
+
hint: composeHint("reddit:posts")
|
|
40
|
+
});
|
|
41
|
+
else uris.push({
|
|
42
|
+
uri: `https://www.reddit.com/r/${subreddit}/.rss`,
|
|
43
|
+
hint: composeHint("reddit:posts")
|
|
44
|
+
});
|
|
45
|
+
uris.push({
|
|
46
|
+
uri: `https://www.reddit.com/r/${subreddit}/comments/.rss`,
|
|
47
|
+
hint: composeHint("reddit:comments")
|
|
48
|
+
});
|
|
34
49
|
return uris;
|
|
35
50
|
}
|
|
36
51
|
const multiredditMatch = pathname.match(/^\/user\/([^/]+)\/m\/([^/]+)/);
|
|
37
|
-
if (multiredditMatch?.[1] && multiredditMatch?.[2]) return [
|
|
52
|
+
if (multiredditMatch?.[1] && multiredditMatch?.[2]) return [{
|
|
53
|
+
uri: `https://www.reddit.com/user/${multiredditMatch[1]}/m/${multiredditMatch[2]}/.rss`,
|
|
54
|
+
hint: composeHint("reddit:multireddit")
|
|
55
|
+
}];
|
|
38
56
|
const userMatch = pathname.match(/^\/(u|user)\/([^/]+)/);
|
|
39
|
-
if (userMatch?.[2]) return [
|
|
57
|
+
if (userMatch?.[2]) return [{
|
|
58
|
+
uri: `https://www.reddit.com/user/${userMatch[2]}/.rss`,
|
|
59
|
+
hint: composeHint("reddit:posts")
|
|
60
|
+
}];
|
|
40
61
|
const domainMatch = pathname.match(/^\/domain\/([^/]+)/);
|
|
41
|
-
if (domainMatch?.[1]) return [
|
|
62
|
+
if (domainMatch?.[1]) return [{
|
|
63
|
+
uri: `https://www.reddit.com/domain/${domainMatch[1]}/.rss`,
|
|
64
|
+
hint: composeHint("reddit:posts")
|
|
65
|
+
}];
|
|
42
66
|
return [];
|
|
43
67
|
}
|
|
44
68
|
};
|
|
@@ -29,7 +29,10 @@ const soundcloudHandler = {
|
|
|
29
29
|
if (!content) return [];
|
|
30
30
|
const userId = extractUserIdFromContent(content);
|
|
31
31
|
if (!userId) return [];
|
|
32
|
-
return [
|
|
32
|
+
return [{
|
|
33
|
+
uri: `https://feeds.soundcloud.com/users/soundcloud:users:${userId}/sounds.rss`,
|
|
34
|
+
hint: require_utils.composeHint("soundcloud:tracks")
|
|
35
|
+
}];
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
1
|
+
import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
2
|
|
|
3
3
|
//#region src/feeds/platform/handlers/soundcloud.ts
|
|
4
4
|
const hosts = [
|
|
@@ -29,7 +29,10 @@ const soundcloudHandler = {
|
|
|
29
29
|
if (!content) return [];
|
|
30
30
|
const userId = extractUserIdFromContent(content);
|
|
31
31
|
if (!userId) return [];
|
|
32
|
-
return [
|
|
32
|
+
return [{
|
|
33
|
+
uri: `https://feeds.soundcloud.com/users/soundcloud:users:${userId}/sounds.rss`,
|
|
34
|
+
hint: composeHint("soundcloud:tracks")
|
|
35
|
+
}];
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSubdomainOf } from "../../../common/utils.js";
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
2
|
|
|
3
3
|
//#region src/feeds/platform/handlers/substack.ts
|
|
4
4
|
const substackHandler = {
|
|
@@ -7,7 +7,10 @@ const substackHandler = {
|
|
|
7
7
|
},
|
|
8
8
|
resolve: (url) => {
|
|
9
9
|
const { origin } = new URL(url);
|
|
10
|
-
return [
|
|
10
|
+
return [{
|
|
11
|
+
uri: `${origin}/feed`,
|
|
12
|
+
hint: composeHint("substack:newsletter")
|
|
13
|
+
}];
|
|
11
14
|
}
|
|
12
15
|
};
|
|
13
16
|
|
|
@@ -9,8 +9,14 @@ const tumblrHandler = {
|
|
|
9
9
|
resolve: (url) => {
|
|
10
10
|
const { origin, pathname } = new URL(url);
|
|
11
11
|
const tagMatch = pathname.match(tagPathRegex);
|
|
12
|
-
if (tagMatch?.[1]) return [
|
|
13
|
-
|
|
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
|
+
}];
|
|
14
20
|
}
|
|
15
21
|
};
|
|
16
22
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSubdomainOf } from "../../../common/utils.js";
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
2
|
|
|
3
3
|
//#region src/feeds/platform/handlers/tumblr.ts
|
|
4
4
|
const tagPathRegex = /^\/tagged\/([^/]+)/;
|
|
@@ -9,8 +9,14 @@ const tumblrHandler = {
|
|
|
9
9
|
resolve: (url) => {
|
|
10
10
|
const { origin, pathname } = new URL(url);
|
|
11
11
|
const tagMatch = pathname.match(tagPathRegex);
|
|
12
|
-
if (tagMatch?.[1]) return [
|
|
13
|
-
|
|
12
|
+
if (tagMatch?.[1]) return [{
|
|
13
|
+
uri: `${origin}/tagged/${tagMatch[1]}/rss`,
|
|
14
|
+
hint: composeHint("tumblr:tag")
|
|
15
|
+
}];
|
|
16
|
+
return [{
|
|
17
|
+
uri: `${origin}/rss`,
|
|
18
|
+
hint: composeHint("tumblr:posts")
|
|
19
|
+
}];
|
|
14
20
|
}
|
|
15
21
|
};
|
|
16
22
|
|
|
@@ -12,16 +12,52 @@ const wordpressHandler = {
|
|
|
12
12
|
const { origin, pathname } = new URL(url);
|
|
13
13
|
const uris = [];
|
|
14
14
|
const categoryMatch = pathname.match(categoryPathRegex);
|
|
15
|
-
if (categoryMatch?.[1]) uris.push(
|
|
15
|
+
if (categoryMatch?.[1]) uris.push({
|
|
16
|
+
uri: `${origin}/category/${categoryMatch[1]}/feed/`,
|
|
17
|
+
hint: require_utils.composeHint("wordpress:category")
|
|
18
|
+
});
|
|
16
19
|
const tagMatch = pathname.match(tagPathRegex);
|
|
17
|
-
if (tagMatch?.[1]) uris.push(
|
|
20
|
+
if (tagMatch?.[1]) uris.push({
|
|
21
|
+
uri: `${origin}/tag/${tagMatch[1]}/feed/`,
|
|
22
|
+
hint: require_utils.composeHint("wordpress:tag")
|
|
23
|
+
});
|
|
18
24
|
const authorMatch = pathname.match(authorPathRegex);
|
|
19
|
-
if (authorMatch?.[1]) uris.push(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
uris.push(
|
|
24
|
-
|
|
25
|
+
if (authorMatch?.[1]) uris.push({
|
|
26
|
+
uri: `${origin}/author/${authorMatch[1]}/feed/`,
|
|
27
|
+
hint: require_utils.composeHint("wordpress:author")
|
|
28
|
+
});
|
|
29
|
+
uris.push({
|
|
30
|
+
uri: [`${origin}/feed/`, `${origin}/?feed=rss`],
|
|
31
|
+
hint: require_utils.composeHint("wordpress:posts-rss2")
|
|
32
|
+
});
|
|
33
|
+
uris.push({
|
|
34
|
+
uri: [`${origin}/feed/rss2/`, `${origin}/?feed=rss2`],
|
|
35
|
+
hint: require_utils.composeHint("wordpress:posts-rss2-alt")
|
|
36
|
+
});
|
|
37
|
+
uris.push({
|
|
38
|
+
uri: [`${origin}/feed/rdf/`, `${origin}/?feed=rdf`],
|
|
39
|
+
hint: require_utils.composeHint("wordpress:posts-rdf")
|
|
40
|
+
});
|
|
41
|
+
uris.push({
|
|
42
|
+
uri: [`${origin}/feed/atom/`, `${origin}/?feed=atom`],
|
|
43
|
+
hint: require_utils.composeHint("wordpress:posts-atom")
|
|
44
|
+
});
|
|
45
|
+
uris.push({
|
|
46
|
+
uri: [`${origin}/comments/feed/`, `${origin}/?feed=comments-rss2`],
|
|
47
|
+
hint: require_utils.composeHint("wordpress:comments")
|
|
48
|
+
});
|
|
49
|
+
uris.push({
|
|
50
|
+
uri: [`${origin}/comments/feed/rss2/`, `${origin}/?feed=comments-rss2`],
|
|
51
|
+
hint: require_utils.composeHint("wordpress:comments-rss2")
|
|
52
|
+
});
|
|
53
|
+
uris.push({
|
|
54
|
+
uri: [`${origin}/comments/feed/rdf/`, `${origin}/?feed=comments-rdf`],
|
|
55
|
+
hint: require_utils.composeHint("wordpress:comments-rdf")
|
|
56
|
+
});
|
|
57
|
+
uris.push({
|
|
58
|
+
uri: [`${origin}/comments/feed/atom/`, `${origin}/?feed=comments-atom`],
|
|
59
|
+
hint: require_utils.composeHint("wordpress:comments-atom")
|
|
60
|
+
});
|
|
25
61
|
return uris;
|
|
26
62
|
}
|
|
27
63
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSubdomainOf } from "../../../common/utils.js";
|
|
1
|
+
import { composeHint, isSubdomainOf } from "../../../common/utils.js";
|
|
2
2
|
|
|
3
3
|
//#region src/feeds/platform/handlers/wordpress.ts
|
|
4
4
|
const categoryPathRegex = /^\/category\/([^/]+)/;
|
|
@@ -12,16 +12,52 @@ const wordpressHandler = {
|
|
|
12
12
|
const { origin, pathname } = new URL(url);
|
|
13
13
|
const uris = [];
|
|
14
14
|
const categoryMatch = pathname.match(categoryPathRegex);
|
|
15
|
-
if (categoryMatch?.[1]) uris.push(
|
|
15
|
+
if (categoryMatch?.[1]) uris.push({
|
|
16
|
+
uri: `${origin}/category/${categoryMatch[1]}/feed/`,
|
|
17
|
+
hint: composeHint("wordpress:category")
|
|
18
|
+
});
|
|
16
19
|
const tagMatch = pathname.match(tagPathRegex);
|
|
17
|
-
if (tagMatch?.[1]) uris.push(
|
|
20
|
+
if (tagMatch?.[1]) uris.push({
|
|
21
|
+
uri: `${origin}/tag/${tagMatch[1]}/feed/`,
|
|
22
|
+
hint: composeHint("wordpress:tag")
|
|
23
|
+
});
|
|
18
24
|
const authorMatch = pathname.match(authorPathRegex);
|
|
19
|
-
if (authorMatch?.[1]) uris.push(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
uris.push(
|
|
24
|
-
|
|
25
|
+
if (authorMatch?.[1]) uris.push({
|
|
26
|
+
uri: `${origin}/author/${authorMatch[1]}/feed/`,
|
|
27
|
+
hint: composeHint("wordpress:author")
|
|
28
|
+
});
|
|
29
|
+
uris.push({
|
|
30
|
+
uri: [`${origin}/feed/`, `${origin}/?feed=rss`],
|
|
31
|
+
hint: composeHint("wordpress:posts-rss2")
|
|
32
|
+
});
|
|
33
|
+
uris.push({
|
|
34
|
+
uri: [`${origin}/feed/rss2/`, `${origin}/?feed=rss2`],
|
|
35
|
+
hint: composeHint("wordpress:posts-rss2-alt")
|
|
36
|
+
});
|
|
37
|
+
uris.push({
|
|
38
|
+
uri: [`${origin}/feed/rdf/`, `${origin}/?feed=rdf`],
|
|
39
|
+
hint: composeHint("wordpress:posts-rdf")
|
|
40
|
+
});
|
|
41
|
+
uris.push({
|
|
42
|
+
uri: [`${origin}/feed/atom/`, `${origin}/?feed=atom`],
|
|
43
|
+
hint: composeHint("wordpress:posts-atom")
|
|
44
|
+
});
|
|
45
|
+
uris.push({
|
|
46
|
+
uri: [`${origin}/comments/feed/`, `${origin}/?feed=comments-rss2`],
|
|
47
|
+
hint: composeHint("wordpress:comments")
|
|
48
|
+
});
|
|
49
|
+
uris.push({
|
|
50
|
+
uri: [`${origin}/comments/feed/rss2/`, `${origin}/?feed=comments-rss2`],
|
|
51
|
+
hint: composeHint("wordpress:comments-rss2")
|
|
52
|
+
});
|
|
53
|
+
uris.push({
|
|
54
|
+
uri: [`${origin}/comments/feed/rdf/`, `${origin}/?feed=comments-rdf`],
|
|
55
|
+
hint: composeHint("wordpress:comments-rdf")
|
|
56
|
+
});
|
|
57
|
+
uris.push({
|
|
58
|
+
uri: [`${origin}/comments/feed/atom/`, `${origin}/?feed=comments-atom`],
|
|
59
|
+
hint: composeHint("wordpress:comments-atom")
|
|
60
|
+
});
|
|
25
61
|
return uris;
|
|
26
62
|
}
|
|
27
63
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_utils = require('../../../common/utils.cjs');
|
|
2
|
+
const require_wordpress = require('./wordpress.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/feeds/platform/handlers/wpengine.ts
|
|
5
|
+
const wpengineHandler = {
|
|
6
|
+
match: (url) => {
|
|
7
|
+
return require_utils.isSubdomainOf(url, "wpenginepowered.com") || require_utils.isSubdomainOf(url, "wpengine.com");
|
|
8
|
+
},
|
|
9
|
+
resolve: require_wordpress.wordpressHandler.resolve
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.wpengineHandler = wpengineHandler;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
import { wordpressHandler } from "./wordpress.js";
|
|
3
|
+
|
|
4
|
+
//#region src/feeds/platform/handlers/wpengine.ts
|
|
5
|
+
const wpengineHandler = {
|
|
6
|
+
match: (url) => {
|
|
7
|
+
return isSubdomainOf(url, "wpenginepowered.com") || isSubdomainOf(url, "wpengine.com");
|
|
8
|
+
},
|
|
9
|
+
resolve: wordpressHandler.resolve
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { wpengineHandler };
|
|
@@ -22,6 +22,20 @@ const getVideosOnlyPlaylistId = (channelId) => {
|
|
|
22
22
|
const getShortsOnlyPlaylistId = (channelId) => {
|
|
23
23
|
return channelId.replace(/^UC/, "UUSH");
|
|
24
24
|
};
|
|
25
|
+
const pushChannelUris = (uris, channelId) => {
|
|
26
|
+
uris.push({
|
|
27
|
+
uri: `https://www.youtube.com/feeds/videos.xml?channel_id=${channelId}`,
|
|
28
|
+
hint: require_utils.composeHint("youtube:all")
|
|
29
|
+
});
|
|
30
|
+
uris.push({
|
|
31
|
+
uri: `https://www.youtube.com/feeds/videos.xml?playlist_id=${getVideosOnlyPlaylistId(channelId)}`,
|
|
32
|
+
hint: require_utils.composeHint("youtube:videos")
|
|
33
|
+
});
|
|
34
|
+
uris.push({
|
|
35
|
+
uri: `https://www.youtube.com/feeds/videos.xml?playlist_id=${getShortsOnlyPlaylistId(channelId)}`,
|
|
36
|
+
hint: require_utils.composeHint("youtube:shorts")
|
|
37
|
+
});
|
|
38
|
+
};
|
|
25
39
|
const youtubeHandler = {
|
|
26
40
|
match: (url) => {
|
|
27
41
|
return require_utils.isHostOf(url, hosts);
|
|
@@ -32,20 +46,17 @@ const youtubeHandler = {
|
|
|
32
46
|
const channelMatch = parsedUrl.pathname.match(channelPathRegex);
|
|
33
47
|
if (channelMatch?.[1]) {
|
|
34
48
|
const channelId = channelMatch[1];
|
|
35
|
-
uris
|
|
36
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getVideosOnlyPlaylistId(channelId)}`);
|
|
37
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getShortsOnlyPlaylistId(channelId)}`);
|
|
49
|
+
pushChannelUris(uris, channelId);
|
|
38
50
|
}
|
|
39
51
|
const playlistId = parsedUrl.searchParams.get("list");
|
|
40
|
-
if (playlistId) uris.push(
|
|
52
|
+
if (playlistId) uris.push({
|
|
53
|
+
uri: `https://www.youtube.com/feeds/videos.xml?playlist_id=${playlistId}`,
|
|
54
|
+
hint: require_utils.composeHint("youtube:playlist")
|
|
55
|
+
});
|
|
41
56
|
if (uris.length === 0 && content) {
|
|
42
57
|
if (parsedUrl.searchParams.has("v") || parsedUrl.hostname.includes("youtu.be") && parsedUrl.pathname.length > 1 || parsedUrl.pathname.match(handlePathRegex) || parsedUrl.pathname.match(userPathRegex) || parsedUrl.pathname.match(customPathRegex)) {
|
|
43
58
|
const channelId = extractChannelIdFromContent(content);
|
|
44
|
-
if (channelId)
|
|
45
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?channel_id=${channelId}`);
|
|
46
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getVideosOnlyPlaylistId(channelId)}`);
|
|
47
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getShortsOnlyPlaylistId(channelId)}`);
|
|
48
|
-
}
|
|
59
|
+
if (channelId) pushChannelUris(uris, channelId);
|
|
49
60
|
}
|
|
50
61
|
}
|
|
51
62
|
return uris;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isHostOf } from "../../../common/utils.js";
|
|
1
|
+
import { composeHint, isHostOf } from "../../../common/utils.js";
|
|
2
2
|
|
|
3
3
|
//#region src/feeds/platform/handlers/youtube.ts
|
|
4
4
|
const hosts = [
|
|
@@ -22,6 +22,20 @@ const getVideosOnlyPlaylistId = (channelId) => {
|
|
|
22
22
|
const getShortsOnlyPlaylistId = (channelId) => {
|
|
23
23
|
return channelId.replace(/^UC/, "UUSH");
|
|
24
24
|
};
|
|
25
|
+
const pushChannelUris = (uris, channelId) => {
|
|
26
|
+
uris.push({
|
|
27
|
+
uri: `https://www.youtube.com/feeds/videos.xml?channel_id=${channelId}`,
|
|
28
|
+
hint: composeHint("youtube:all")
|
|
29
|
+
});
|
|
30
|
+
uris.push({
|
|
31
|
+
uri: `https://www.youtube.com/feeds/videos.xml?playlist_id=${getVideosOnlyPlaylistId(channelId)}`,
|
|
32
|
+
hint: composeHint("youtube:videos")
|
|
33
|
+
});
|
|
34
|
+
uris.push({
|
|
35
|
+
uri: `https://www.youtube.com/feeds/videos.xml?playlist_id=${getShortsOnlyPlaylistId(channelId)}`,
|
|
36
|
+
hint: composeHint("youtube:shorts")
|
|
37
|
+
});
|
|
38
|
+
};
|
|
25
39
|
const youtubeHandler = {
|
|
26
40
|
match: (url) => {
|
|
27
41
|
return isHostOf(url, hosts);
|
|
@@ -32,20 +46,17 @@ const youtubeHandler = {
|
|
|
32
46
|
const channelMatch = parsedUrl.pathname.match(channelPathRegex);
|
|
33
47
|
if (channelMatch?.[1]) {
|
|
34
48
|
const channelId = channelMatch[1];
|
|
35
|
-
uris
|
|
36
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getVideosOnlyPlaylistId(channelId)}`);
|
|
37
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getShortsOnlyPlaylistId(channelId)}`);
|
|
49
|
+
pushChannelUris(uris, channelId);
|
|
38
50
|
}
|
|
39
51
|
const playlistId = parsedUrl.searchParams.get("list");
|
|
40
|
-
if (playlistId) uris.push(
|
|
52
|
+
if (playlistId) uris.push({
|
|
53
|
+
uri: `https://www.youtube.com/feeds/videos.xml?playlist_id=${playlistId}`,
|
|
54
|
+
hint: composeHint("youtube:playlist")
|
|
55
|
+
});
|
|
41
56
|
if (uris.length === 0 && content) {
|
|
42
57
|
if (parsedUrl.searchParams.has("v") || parsedUrl.hostname.includes("youtu.be") && parsedUrl.pathname.length > 1 || parsedUrl.pathname.match(handlePathRegex) || parsedUrl.pathname.match(userPathRegex) || parsedUrl.pathname.match(customPathRegex)) {
|
|
43
58
|
const channelId = extractChannelIdFromContent(content);
|
|
44
|
-
if (channelId)
|
|
45
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?channel_id=${channelId}`);
|
|
46
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getVideosOnlyPlaylistId(channelId)}`);
|
|
47
|
-
uris.push(`https://www.youtube.com/feeds/videos.xml?playlist_id=${getShortsOnlyPlaylistId(channelId)}`);
|
|
48
|
-
}
|
|
59
|
+
if (channelId) pushChannelUris(uris, channelId);
|
|
49
60
|
}
|
|
50
61
|
}
|
|
51
62
|
return uris;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethodsConfig, DiscoverNormalizeUrlFn, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResult } from "./common/types.cjs";
|
|
1
|
+
import { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethodsConfig, DiscoverNormalizeUrlFn, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResult, DiscoverUriEntry, DiscoverUriHint, UriEntry } from "./common/types.cjs";
|
|
2
2
|
import { discoverBlogrolls } from "./blogrolls/index.cjs";
|
|
3
3
|
import { discoverFeeds } from "./feeds/index.cjs";
|
|
4
4
|
import { discoverHubs } from "./hubs/discover/index.cjs";
|
|
5
|
-
export { type DiscoverExtractFn, type DiscoverFetchFn, type DiscoverFetchFnOptions, type DiscoverFetchFnResponse, type DiscoverInput, type DiscoverInputObject, type DiscoverMethodsConfig, type DiscoverNormalizeUrlFn, type DiscoverOnProgressFn, type DiscoverOptions, type DiscoverProgress, type DiscoverResult, discoverBlogrolls, discoverFeeds, discoverHubs };
|
|
5
|
+
export { type DiscoverExtractFn, type DiscoverFetchFn, type DiscoverFetchFnOptions, type DiscoverFetchFnResponse, type DiscoverInput, type DiscoverInputObject, type DiscoverMethodsConfig, type DiscoverNormalizeUrlFn, type DiscoverOnProgressFn, type DiscoverOptions, type DiscoverProgress, type DiscoverResult, type DiscoverUriEntry, type DiscoverUriHint, type UriEntry, discoverBlogrolls, discoverFeeds, discoverHubs };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethodsConfig, DiscoverNormalizeUrlFn, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResult } from "./common/types.js";
|
|
1
|
+
import { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethodsConfig, DiscoverNormalizeUrlFn, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResult, DiscoverUriEntry, DiscoverUriHint, UriEntry } from "./common/types.js";
|
|
2
2
|
import { discoverBlogrolls } from "./blogrolls/index.js";
|
|
3
3
|
import { discoverFeeds } from "./feeds/index.js";
|
|
4
4
|
import { discoverHubs } from "./hubs/discover/index.js";
|
|
5
|
-
export { type DiscoverExtractFn, type DiscoverFetchFn, type DiscoverFetchFnOptions, type DiscoverFetchFnResponse, type DiscoverInput, type DiscoverInputObject, type DiscoverMethodsConfig, type DiscoverNormalizeUrlFn, type DiscoverOnProgressFn, type DiscoverOptions, type DiscoverProgress, type DiscoverResult, discoverBlogrolls, discoverFeeds, discoverHubs };
|
|
5
|
+
export { type DiscoverExtractFn, type DiscoverFetchFn, type DiscoverFetchFnOptions, type DiscoverFetchFnResponse, type DiscoverInput, type DiscoverInputObject, type DiscoverMethodsConfig, type DiscoverNormalizeUrlFn, type DiscoverOnProgressFn, type DiscoverOptions, type DiscoverProgress, type DiscoverResult, type DiscoverUriEntry, type DiscoverUriHint, type UriEntry, discoverBlogrolls, discoverFeeds, discoverHubs };
|
package/package.json
CHANGED