feedscout 1.9.0 → 2.0.0-beta.2
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/defaults.js +1 -3
- package/dist/common/discover/utils.d.ts +2 -3
- package/dist/common/uris/feed/types.d.ts +2 -2
- package/dist/feeds/extractors.js +2 -2
- package/dist/feeds/platform/handlers/discourse.js +2 -6
- package/dist/feeds/platform/handlers/libsyn.js +1 -1
- package/package.json +23 -62
- package/dist/blogrolls/defaults.cjs +0 -57
- package/dist/blogrolls/defaults.d.cts +0 -16
- package/dist/blogrolls/extractors.cjs +0 -21
- package/dist/blogrolls/extractors.d.cts +0 -7
- package/dist/blogrolls/index.cjs +0 -25
- package/dist/blogrolls/index.d.cts +0 -7
- package/dist/blogrolls/types.d.cts +0 -6
- package/dist/blogrolls.cjs +0 -12
- package/dist/blogrolls.d.cts +0 -4
- package/dist/common/discover/defaults.cjs +0 -46
- package/dist/common/discover/defaults.d.cts +0 -6
- package/dist/common/discover/index.cjs +0 -105
- package/dist/common/discover/utils.cjs +0 -101
- package/dist/common/discover/utils.d.cts +0 -6
- package/dist/common/locales.cjs +0 -348
- package/dist/common/types.cjs +0 -10
- package/dist/common/types.d.cts +0 -90
- package/dist/common/uris/feed/index.cjs +0 -12
- package/dist/common/uris/feed/index.d.cts +0 -6
- package/dist/common/uris/feed/types.d.cts +0 -9
- package/dist/common/uris/guess/index.cjs +0 -8
- package/dist/common/uris/guess/index.d.cts +0 -7
- package/dist/common/uris/guess/types.d.cts +0 -10
- package/dist/common/uris/guess/utils.cjs +0 -42
- package/dist/common/uris/guess/utils.d.cts +0 -8
- package/dist/common/uris/headers/index.cjs +0 -26
- package/dist/common/uris/headers/index.d.cts +0 -6
- package/dist/common/uris/headers/types.d.cts +0 -9
- package/dist/common/uris/html/handlers.cjs +0 -59
- package/dist/common/uris/html/index.cjs +0 -35
- package/dist/common/uris/html/index.d.cts +0 -6
- package/dist/common/uris/html/types.d.cts +0 -13
- package/dist/common/uris/index.cjs +0 -32
- package/dist/common/uris/platform/index.cjs +0 -10
- package/dist/common/uris/platform/index.d.cts +0 -7
- package/dist/common/uris/platform/types.d.cts +0 -13
- package/dist/common/utils.cjs +0 -98
- package/dist/common/utils.d.cts +0 -12
- package/dist/favicons/defaults.cjs +0 -65
- package/dist/favicons/defaults.d.cts +0 -18
- package/dist/favicons/extractors.cjs +0 -25
- package/dist/favicons/extractors.d.cts +0 -7
- package/dist/favicons/index.cjs +0 -29
- package/dist/favicons/index.d.cts +0 -7
- package/dist/favicons/platform/handlers/bluesky.cjs +0 -27
- package/dist/favicons/platform/handlers/codeberg.cjs +0 -19
- package/dist/favicons/platform/handlers/deviantart.cjs +0 -29
- package/dist/favicons/platform/handlers/devto.cjs +0 -31
- package/dist/favicons/platform/handlers/github.cjs +0 -19
- package/dist/favicons/platform/handlers/githubGist.cjs +0 -19
- package/dist/favicons/platform/handlers/gitlab.cjs +0 -38
- package/dist/favicons/platform/handlers/lobsters.cjs +0 -21
- package/dist/favicons/platform/handlers/mastodon.cjs +0 -40
- package/dist/favicons/platform/handlers/reddit.cjs +0 -42
- package/dist/favicons/platform/handlers/sourceforge.cjs +0 -21
- package/dist/favicons/platform/handlers/tumblr.cjs +0 -16
- package/dist/favicons/types.d.cts +0 -4
- package/dist/favicons/utils.cjs +0 -10
- package/dist/favicons.cjs +0 -12
- package/dist/favicons.d.cts +0 -4
- package/dist/feeds/defaults.cjs +0 -290
- package/dist/feeds/defaults.d.cts +0 -21
- package/dist/feeds/extractors.cjs +0 -46
- package/dist/feeds/extractors.d.cts +0 -7
- package/dist/feeds/index.cjs +0 -26
- package/dist/feeds/index.d.cts +0 -7
- package/dist/feeds/platform/handlers/acast.cjs +0 -26
- package/dist/feeds/platform/handlers/ameblo.cjs +0 -36
- package/dist/feeds/platform/handlers/applePodcasts.cjs +0 -26
- package/dist/feeds/platform/handlers/arena.cjs +0 -42
- package/dist/feeds/platform/handlers/artstation.cjs +0 -52
- package/dist/feeds/platform/handlers/audioboom.cjs +0 -23
- package/dist/feeds/platform/handlers/bearblog.cjs +0 -45
- package/dist/feeds/platform/handlers/behance.cjs +0 -56
- package/dist/feeds/platform/handlers/blogspot.cjs +0 -72
- package/dist/feeds/platform/handlers/bluesky.cjs +0 -20
- package/dist/feeds/platform/handlers/bookwyrm.cjs +0 -48
- package/dist/feeds/platform/handlers/buttondown.cjs +0 -43
- package/dist/feeds/platform/handlers/buzzsprout.cjs +0 -22
- package/dist/feeds/platform/handlers/codeberg.cjs +0 -69
- package/dist/feeds/platform/handlers/csdn.cjs +0 -20
- package/dist/feeds/platform/handlers/dailymotion.cjs +0 -86
- package/dist/feeds/platform/handlers/deviantart.cjs +0 -85
- package/dist/feeds/platform/handlers/devto.cjs +0 -58
- package/dist/feeds/platform/handlers/discourse.cjs +0 -70
- package/dist/feeds/platform/handlers/douban.cjs +0 -56
- package/dist/feeds/platform/handlers/dreamwidth.cjs +0 -48
- package/dist/feeds/platform/handlers/exblog.cjs +0 -35
- package/dist/feeds/platform/handlers/fireside.cjs +0 -24
- package/dist/feeds/platform/handlers/friendica.cjs +0 -44
- package/dist/feeds/platform/handlers/ghost.cjs +0 -30
- package/dist/feeds/platform/handlers/github.cjs +0 -122
- package/dist/feeds/platform/handlers/githubGist.cjs +0 -56
- package/dist/feeds/platform/handlers/gitlab.cjs +0 -98
- package/dist/feeds/platform/handlers/goodreads.cjs +0 -49
- package/dist/feeds/platform/handlers/hackernews.cjs +0 -21
- package/dist/feeds/platform/handlers/hashnode.cjs +0 -16
- package/dist/feeds/platform/handlers/hatenablog.cjs +0 -56
- package/dist/feeds/platform/handlers/hearthis.cjs +0 -32
- package/dist/feeds/platform/handlers/heyWorld.cjs +0 -18
- package/dist/feeds/platform/handlers/insanejournal.cjs +0 -69
- package/dist/feeds/platform/handlers/itchio.cjs +0 -111
- package/dist/feeds/platform/handlers/kickstarter.cjs +0 -22
- package/dist/feeds/platform/handlers/lemmy.cjs +0 -88
- package/dist/feeds/platform/handlers/letterboxd.cjs +0 -46
- package/dist/feeds/platform/handlers/libsyn.cjs +0 -25
- package/dist/feeds/platform/handlers/listed.cjs +0 -20
- package/dist/feeds/platform/handlers/livejournal.cjs +0 -68
- package/dist/feeds/platform/handlers/lobsters.cjs +0 -57
- package/dist/feeds/platform/handlers/mastodon.cjs +0 -74
- package/dist/feeds/platform/handlers/mataroa.cjs +0 -16
- package/dist/feeds/platform/handlers/medium.cjs +0 -68
- package/dist/feeds/platform/handlers/microblog.cjs +0 -55
- package/dist/feeds/platform/handlers/misskey.cjs +0 -40
- package/dist/feeds/platform/handlers/myanimelist.cjs +0 -43
- package/dist/feeds/platform/handlers/naverBlog.cjs +0 -21
- package/dist/feeds/platform/handlers/nebula.cjs +0 -68
- package/dist/feeds/platform/handlers/note.cjs +0 -53
- package/dist/feeds/platform/handlers/observable.cjs +0 -34
- package/dist/feeds/platform/handlers/odysee.cjs +0 -20
- package/dist/feeds/platform/handlers/pagecord.cjs +0 -16
- package/dist/feeds/platform/handlers/paragraph.cjs +0 -20
- package/dist/feeds/platform/handlers/pika.cjs +0 -35
- package/dist/feeds/platform/handlers/pinterest.cjs +0 -57
- package/dist/feeds/platform/handlers/pixelfed.cjs +0 -46
- package/dist/feeds/platform/handlers/pleroma.cjs +0 -34
- package/dist/feeds/platform/handlers/podbean.cjs +0 -29
- package/dist/feeds/platform/handlers/podigee.cjs +0 -29
- package/dist/feeds/platform/handlers/posthaven.cjs +0 -24
- package/dist/feeds/platform/handlers/producthunt.cjs +0 -29
- package/dist/feeds/platform/handlers/prose.cjs +0 -26
- package/dist/feeds/platform/handlers/qiita.cjs +0 -58
- package/dist/feeds/platform/handlers/reddit.cjs +0 -149
- package/dist/feeds/platform/handlers/rssCom.cjs +0 -20
- package/dist/feeds/platform/handlers/seesaa.cjs +0 -22
- package/dist/feeds/platform/handlers/soundcloud.cjs +0 -39
- package/dist/feeds/platform/handlers/sourceforge.cjs +0 -53
- package/dist/feeds/platform/handlers/spreaker.cjs +0 -21
- package/dist/feeds/platform/handlers/stackExchange.cjs +0 -64
- package/dist/feeds/platform/handlers/steam.cjs +0 -35
- package/dist/feeds/platform/handlers/substack.cjs +0 -23
- package/dist/feeds/platform/handlers/tildes.cjs +0 -41
- package/dist/feeds/platform/handlers/tistory.cjs +0 -16
- package/dist/feeds/platform/handlers/transistor.cjs +0 -29
- package/dist/feeds/platform/handlers/tumblr.cjs +0 -24
- package/dist/feeds/platform/handlers/v2ex.cjs +0 -35
- package/dist/feeds/platform/handlers/velog.cjs +0 -24
- package/dist/feeds/platform/handlers/vimeo.cjs +0 -75
- package/dist/feeds/platform/handlers/weblogLol.cjs +0 -26
- package/dist/feeds/platform/handlers/weebly.cjs +0 -25
- package/dist/feeds/platform/handlers/wordpress.cjs +0 -209
- package/dist/feeds/platform/handlers/wpengine.cjs +0 -10
- package/dist/feeds/platform/handlers/writeas.cjs +0 -51
- package/dist/feeds/platform/handlers/ximalaya.cjs +0 -20
- package/dist/feeds/platform/handlers/youtube.cjs +0 -97
- package/dist/feeds/platform/handlers/zenn.cjs +0 -54
- package/dist/feeds/types.d.cts +0 -9
- package/dist/feeds.cjs +0 -16
- package/dist/feeds.d.cts +0 -4
- package/dist/hubs/discover/index.cjs +0 -30
- package/dist/hubs/discover/index.d.cts +0 -7
- package/dist/hubs/discover/types.d.cts +0 -15
- package/dist/hubs/feed/index.cjs +0 -32
- package/dist/hubs/headers/index.cjs +0 -17
- package/dist/hubs/html/index.cjs +0 -28
- package/dist/hubs.cjs +0 -0
- package/dist/hubs.d.cts +0 -2
- package/dist/index.cjs +0 -13
- package/dist/index.d.cts +0 -8
- package/dist/methods.cjs +0 -15
- package/dist/methods.d.cts +0 -7
- package/dist/utils.cjs +0 -9
- package/dist/utils.d.cts +0 -3
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/devto.ts
|
|
3
|
-
const hosts = ["dev.to", "www.dev.to"];
|
|
4
|
-
const userRegex = /^\/([a-zA-Z0-9_]+)\/?$/;
|
|
5
|
-
const tagRegex = /^\/t\/([^/]+)/;
|
|
6
|
-
const excludedPaths = [
|
|
7
|
-
"tag",
|
|
8
|
-
"tags",
|
|
9
|
-
"search",
|
|
10
|
-
"top",
|
|
11
|
-
"latest",
|
|
12
|
-
"about",
|
|
13
|
-
"contact",
|
|
14
|
-
"privacy",
|
|
15
|
-
"terms",
|
|
16
|
-
"code-of-conduct",
|
|
17
|
-
"faq",
|
|
18
|
-
"enter",
|
|
19
|
-
"settings",
|
|
20
|
-
"signout-confirm",
|
|
21
|
-
"notifications",
|
|
22
|
-
"reading-list",
|
|
23
|
-
"dashboard"
|
|
24
|
-
];
|
|
25
|
-
const devtoHandler = {
|
|
26
|
-
match: (url) => {
|
|
27
|
-
return require_utils.isHostOf(url, hosts);
|
|
28
|
-
},
|
|
29
|
-
resolve: (url) => {
|
|
30
|
-
const { pathname } = new URL(url);
|
|
31
|
-
if (pathname === "/" || pathname === "") return [{
|
|
32
|
-
uri: "https://dev.to/feed",
|
|
33
|
-
hint: require_utils.composeHint("devto:community")
|
|
34
|
-
}];
|
|
35
|
-
if (pathname === "/latest" || pathname === "/latest/") return [{
|
|
36
|
-
uri: "https://dev.to/feed/latest",
|
|
37
|
-
hint: require_utils.composeHint("devto:latest")
|
|
38
|
-
}];
|
|
39
|
-
const userMatch = pathname.match(userRegex);
|
|
40
|
-
if (userMatch?.[1]) {
|
|
41
|
-
const username = userMatch[1];
|
|
42
|
-
if (!require_utils.isAnyOf(username, excludedPaths)) return [{
|
|
43
|
-
uri: `https://dev.to/feed/${username}`,
|
|
44
|
-
hint: require_utils.composeHint("devto:posts")
|
|
45
|
-
}];
|
|
46
|
-
}
|
|
47
|
-
const tagMatch = pathname.match(tagRegex);
|
|
48
|
-
if (tagMatch?.[1]) return [{
|
|
49
|
-
uri: `https://dev.to/feed/tag/${tagMatch[1]}`,
|
|
50
|
-
hint: require_utils.composeHint("devto:tag")
|
|
51
|
-
}];
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
//#endregion
|
|
56
|
-
exports.devtoHandler = devtoHandler;
|
|
57
|
-
exports.excludedPaths = excludedPaths;
|
|
58
|
-
exports.hosts = hosts;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/discourse.ts
|
|
3
|
-
const userRegex = /^\/u\/([^/]+)/;
|
|
4
|
-
const categoryRegex = /^\/c\/(.+?)\/?$/;
|
|
5
|
-
const topicRegex = /^\/t\/([^/]+)\/(\d+)/;
|
|
6
|
-
const topRegex = /^\/top(?:\/([^/]+))?\/?$/;
|
|
7
|
-
const validTopPeriods = new Set([
|
|
8
|
-
"daily",
|
|
9
|
-
"weekly",
|
|
10
|
-
"monthly",
|
|
11
|
-
"quarterly",
|
|
12
|
-
"yearly",
|
|
13
|
-
"all"
|
|
14
|
-
]);
|
|
15
|
-
const getTopPeriodSuffix = (pathPeriod, searchParams) => {
|
|
16
|
-
const period = pathPeriod ?? searchParams.get("period") ?? void 0;
|
|
17
|
-
if (period && validTopPeriods.has(period)) return `?period=${period}`;
|
|
18
|
-
return "";
|
|
19
|
-
};
|
|
20
|
-
const isDiscourseHtml = (content) => {
|
|
21
|
-
return require_utils.hasMetaContent(content, "generator", "Discourse");
|
|
22
|
-
};
|
|
23
|
-
const discourseHandler = {
|
|
24
|
-
match: (url, content) => {
|
|
25
|
-
try {
|
|
26
|
-
if (!content || !isDiscourseHtml(content)) return false;
|
|
27
|
-
new URL(url);
|
|
28
|
-
return true;
|
|
29
|
-
} catch {}
|
|
30
|
-
return false;
|
|
31
|
-
},
|
|
32
|
-
resolve: (url) => {
|
|
33
|
-
try {
|
|
34
|
-
const { origin, pathname, searchParams } = new URL(url);
|
|
35
|
-
const topicMatch = pathname.match(topicRegex);
|
|
36
|
-
if (topicMatch?.[1] && topicMatch?.[2]) return [{
|
|
37
|
-
uri: `${origin}/t/${topicMatch[1]}/${topicMatch[2]}.rss`,
|
|
38
|
-
hint: require_utils.composeHint("discourse:topic")
|
|
39
|
-
}];
|
|
40
|
-
const userMatch = pathname.match(userRegex);
|
|
41
|
-
if (userMatch?.[1]) return [{
|
|
42
|
-
uri: `${origin}/u/${userMatch[1]}/activity.rss`,
|
|
43
|
-
hint: require_utils.composeHint("discourse:activity")
|
|
44
|
-
}];
|
|
45
|
-
const categoryMatch = pathname.match(categoryRegex);
|
|
46
|
-
if (categoryMatch?.[1]) return [{
|
|
47
|
-
uri: `${origin}/c/${categoryMatch[1]}.rss`,
|
|
48
|
-
hint: require_utils.composeHint("discourse:category")
|
|
49
|
-
}];
|
|
50
|
-
const topMatch = pathname.match(topRegex);
|
|
51
|
-
if (topMatch) return [{
|
|
52
|
-
uri: `${origin}/top.rss${getTopPeriodSuffix(topMatch[1], searchParams)}`,
|
|
53
|
-
hint: require_utils.composeHint("discourse:top")
|
|
54
|
-
}];
|
|
55
|
-
const uris = [];
|
|
56
|
-
uris.push({
|
|
57
|
-
uri: `${origin}/latest.rss`,
|
|
58
|
-
hint: require_utils.composeHint("discourse:latest")
|
|
59
|
-
});
|
|
60
|
-
uris.push({
|
|
61
|
-
uri: `${origin}/posts.rss`,
|
|
62
|
-
hint: require_utils.composeHint("discourse:posts")
|
|
63
|
-
});
|
|
64
|
-
return uris;
|
|
65
|
-
} catch {}
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
//#endregion
|
|
70
|
-
exports.discourseHandler = discourseHandler;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/douban.ts
|
|
3
|
-
const userRegex = /^\/people\/([^/]+)/;
|
|
4
|
-
const subjectRegex = /^\/subject\/(\d+)/;
|
|
5
|
-
const doubanHandler = {
|
|
6
|
-
match: (url) => {
|
|
7
|
-
return require_utils.isHostOf(url, "douban.com") || require_utils.isSubdomainOf(url, "douban.com");
|
|
8
|
-
},
|
|
9
|
-
resolve: (url) => {
|
|
10
|
-
const { pathname } = new URL(url);
|
|
11
|
-
const userMatch = pathname.match(userRegex);
|
|
12
|
-
if (userMatch?.[1]) {
|
|
13
|
-
const user = userMatch[1];
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
uri: `https://www.douban.com/feed/people/${user}/interests`,
|
|
17
|
-
hint: require_utils.composeHint("douban:interests")
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
uri: `https://www.douban.com/feed/people/${user}/reviews`,
|
|
21
|
-
hint: require_utils.composeHint("douban:reviews")
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
uri: `https://www.douban.com/feed/people/${user}/notes`,
|
|
25
|
-
hint: require_utils.composeHint("douban:notes")
|
|
26
|
-
}
|
|
27
|
-
];
|
|
28
|
-
}
|
|
29
|
-
const subjectMatch = pathname.match(subjectRegex);
|
|
30
|
-
if (subjectMatch?.[1]) return [{
|
|
31
|
-
uri: `https://www.douban.com/feed/subject/${subjectMatch[1]}/reviews`,
|
|
32
|
-
hint: require_utils.composeHint("douban:subjectReviews")
|
|
33
|
-
}];
|
|
34
|
-
if (pathname === "/" || pathname === "") return [
|
|
35
|
-
{
|
|
36
|
-
uri: "https://www.douban.com/feed/review/book",
|
|
37
|
-
hint: require_utils.composeHint("douban:reviews")
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
uri: "https://www.douban.com/feed/review/movie",
|
|
41
|
-
hint: require_utils.composeHint("douban:reviews")
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
uri: "https://www.douban.com/feed/review/music",
|
|
45
|
-
hint: require_utils.composeHint("douban:reviews")
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
uri: "https://www.douban.com/feed/review/drama",
|
|
49
|
-
hint: require_utils.composeHint("douban:reviews")
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
//#endregion
|
|
56
|
-
exports.doubanHandler = doubanHandler;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/dreamwidth.ts
|
|
3
|
-
const usersPathRegex = /^\/(?:users\/|~)([^/]+)/;
|
|
4
|
-
const tagRegex = /^\/tag\/([^/]+)/;
|
|
5
|
-
const dreamwidthHandler = {
|
|
6
|
-
match: (url) => {
|
|
7
|
-
if (!require_utils.isSubdomainOf(url, "dreamwidth.org")) return false;
|
|
8
|
-
if (require_utils.isHostOf(url, ["www.dreamwidth.org", "dreamwidth.org"])) return usersPathRegex.test(new URL(url).pathname);
|
|
9
|
-
return true;
|
|
10
|
-
},
|
|
11
|
-
resolve: (url) => {
|
|
12
|
-
const { origin, pathname } = new URL(url);
|
|
13
|
-
const uris = [];
|
|
14
|
-
let userOrigin = origin;
|
|
15
|
-
if (require_utils.isHostOf(url, ["www.dreamwidth.org", "dreamwidth.org"])) {
|
|
16
|
-
const userMatch = pathname.match(usersPathRegex);
|
|
17
|
-
if (userMatch?.[1]) userOrigin = `https://${userMatch[1]}.dreamwidth.org`;
|
|
18
|
-
else return uris;
|
|
19
|
-
}
|
|
20
|
-
const tagMatch = pathname.match(tagRegex);
|
|
21
|
-
if (tagMatch?.[1]) {
|
|
22
|
-
const tag = encodeURIComponent(tagMatch[1]);
|
|
23
|
-
uris.push({
|
|
24
|
-
uri: `${userOrigin}/data/rss?tag=${tag}`,
|
|
25
|
-
hint: require_utils.composeHint("dreamwidth:posts-tag-rss")
|
|
26
|
-
});
|
|
27
|
-
uris.push({
|
|
28
|
-
uri: `${userOrigin}/data/atom?tag=${tag}`,
|
|
29
|
-
hint: require_utils.composeHint("dreamwidth:posts-tag-atom")
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
uris.push({
|
|
33
|
-
uri: `${userOrigin}/data/rss`,
|
|
34
|
-
hint: require_utils.composeHint("dreamwidth:posts-rss")
|
|
35
|
-
});
|
|
36
|
-
uris.push({
|
|
37
|
-
uri: `${userOrigin}/data/atom`,
|
|
38
|
-
hint: require_utils.composeHint("dreamwidth:posts-atom")
|
|
39
|
-
});
|
|
40
|
-
uris.push({
|
|
41
|
-
uri: `${userOrigin}/data/userpics`,
|
|
42
|
-
hint: require_utils.composeHint("dreamwidth:userpics-atom")
|
|
43
|
-
});
|
|
44
|
-
return uris;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
//#endregion
|
|
48
|
-
exports.dreamwidthHandler = dreamwidthHandler;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/exblog.ts
|
|
3
|
-
const categoryRegex = /^\/i(\d+)/;
|
|
4
|
-
const exblogHandler = {
|
|
5
|
-
match: (url) => {
|
|
6
|
-
return require_utils.isSubdomainOf(url, "exblog.jp");
|
|
7
|
-
},
|
|
8
|
-
resolve: (url) => {
|
|
9
|
-
const { origin, pathname } = new URL(url);
|
|
10
|
-
const uris = [];
|
|
11
|
-
const categoryMatch = pathname.match(categoryRegex);
|
|
12
|
-
if (categoryMatch?.[1]) {
|
|
13
|
-
const categoryId = categoryMatch[1];
|
|
14
|
-
uris.push({
|
|
15
|
-
uri: `${origin}/i${categoryId}/index.xml`,
|
|
16
|
-
hint: require_utils.composeHint("exblog:category-rss")
|
|
17
|
-
});
|
|
18
|
-
uris.push({
|
|
19
|
-
uri: `${origin}/i${categoryId}/atom.xml`,
|
|
20
|
-
hint: require_utils.composeHint("exblog:category-atom")
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
uris.push({
|
|
24
|
-
uri: `${origin}/index.xml`,
|
|
25
|
-
hint: require_utils.composeHint("exblog:posts-rss")
|
|
26
|
-
});
|
|
27
|
-
uris.push({
|
|
28
|
-
uri: `${origin}/atom.xml`,
|
|
29
|
-
hint: require_utils.composeHint("exblog:posts-atom")
|
|
30
|
-
});
|
|
31
|
-
return uris;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
//#endregion
|
|
35
|
-
exports.exblogHandler = exblogHandler;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/fireside.ts
|
|
3
|
-
const domainSuffix = /\.fireside\.fm$/i;
|
|
4
|
-
const firesideHandler = {
|
|
5
|
-
match: (url) => {
|
|
6
|
-
return require_utils.isSubdomainOf(url, "fireside.fm");
|
|
7
|
-
},
|
|
8
|
-
resolve: (url) => {
|
|
9
|
-
const { hostname } = new URL(url);
|
|
10
|
-
const slug = hostname.replace(domainSuffix, "");
|
|
11
|
-
const uris = [];
|
|
12
|
-
uris.push({
|
|
13
|
-
uri: `https://feeds.fireside.fm/${slug}/rss`,
|
|
14
|
-
hint: require_utils.composeHint("fireside:podcast-rss")
|
|
15
|
-
});
|
|
16
|
-
uris.push({
|
|
17
|
-
uri: `https://${slug}.fireside.fm/json`,
|
|
18
|
-
hint: require_utils.composeHint("fireside:podcast-json")
|
|
19
|
-
});
|
|
20
|
-
return uris;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
exports.firesideHandler = firesideHandler;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/friendica.ts
|
|
3
|
-
const profileRegex = /^\/profile\/([^/]+)/;
|
|
4
|
-
const isFriendicaHtml = (content) => {
|
|
5
|
-
return require_utils.hasMetaContent(content, "generator", "Friendica");
|
|
6
|
-
};
|
|
7
|
-
const friendicaHandler = {
|
|
8
|
-
match: (url, content) => {
|
|
9
|
-
try {
|
|
10
|
-
if (!content || !isFriendicaHtml(content)) return false;
|
|
11
|
-
const { pathname } = new URL(url);
|
|
12
|
-
return profileRegex.test(pathname);
|
|
13
|
-
} catch {}
|
|
14
|
-
return false;
|
|
15
|
-
},
|
|
16
|
-
resolve: (url) => {
|
|
17
|
-
try {
|
|
18
|
-
const { origin, pathname } = new URL(url);
|
|
19
|
-
const match = pathname.match(profileRegex);
|
|
20
|
-
if (!match?.[1]) return [];
|
|
21
|
-
return [
|
|
22
|
-
{
|
|
23
|
-
uri: `${origin}/feed/${match[1]}`,
|
|
24
|
-
hint: require_utils.composeHint("friendica:posts")
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
uri: `${origin}/feed/${match[1]}/comments`,
|
|
28
|
-
hint: require_utils.composeHint("friendica:comments")
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
uri: `${origin}/feed/${match[1]}/replies`,
|
|
32
|
-
hint: require_utils.composeHint("friendica:replies")
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
uri: `${origin}/feed/${match[1]}/activity`,
|
|
36
|
-
hint: require_utils.composeHint("friendica:activity")
|
|
37
|
-
}
|
|
38
|
-
];
|
|
39
|
-
} catch {}
|
|
40
|
-
return [];
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
//#endregion
|
|
44
|
-
exports.friendicaHandler = friendicaHandler;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/ghost.ts
|
|
3
|
-
const tagRegex = /^\/tag\/([^/]+)/;
|
|
4
|
-
const authorRegex = /^\/author\/([^/]+)/;
|
|
5
|
-
const ghostHandler = {
|
|
6
|
-
match: (url) => {
|
|
7
|
-
return require_utils.isSubdomainOf(url, "ghost.io");
|
|
8
|
-
},
|
|
9
|
-
resolve: (url) => {
|
|
10
|
-
const { origin, pathname } = new URL(url);
|
|
11
|
-
const uris = [];
|
|
12
|
-
const tagMatch = pathname.match(tagRegex);
|
|
13
|
-
if (tagMatch?.[1]) uris.push({
|
|
14
|
-
uri: `${origin}/tag/${tagMatch[1]}/rss/`,
|
|
15
|
-
hint: require_utils.composeHint("ghost:tag")
|
|
16
|
-
});
|
|
17
|
-
const authorMatch = pathname.match(authorRegex);
|
|
18
|
-
if (authorMatch?.[1]) uris.push({
|
|
19
|
-
uri: `${origin}/author/${authorMatch[1]}/rss/`,
|
|
20
|
-
hint: require_utils.composeHint("ghost:author")
|
|
21
|
-
});
|
|
22
|
-
uris.push({
|
|
23
|
-
uri: `${origin}/rss/`,
|
|
24
|
-
hint: require_utils.composeHint("ghost:blog")
|
|
25
|
-
});
|
|
26
|
-
return uris;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.ghostHandler = ghostHandler;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/github.ts
|
|
3
|
-
const userRegex = /^\/([^/]+)\/?$/;
|
|
4
|
-
const repoRegex = /^\/([^/]+)\/([^/]+)/;
|
|
5
|
-
const wikiRegex = /\/wiki(\/|$)/;
|
|
6
|
-
const discussionsRegex = /\/discussions(\/|$)/;
|
|
7
|
-
const discussionCategoryRegex = /\/discussions\/categories\/([^/]+)/;
|
|
8
|
-
const branchRegex = /^\/[^/]+\/[^/]+\/tree\/([^/]+)\/?$/;
|
|
9
|
-
const fileRegex = /^\/[^/]+\/[^/]+\/(?:blob|commits)\/([^/]+)\/(.+)/;
|
|
10
|
-
const hosts = ["github.com", "www.github.com"];
|
|
11
|
-
const excludedPaths = [
|
|
12
|
-
"about",
|
|
13
|
-
"account",
|
|
14
|
-
"apps",
|
|
15
|
-
"blog",
|
|
16
|
-
"careers",
|
|
17
|
-
"codespaces",
|
|
18
|
-
"collections",
|
|
19
|
-
"contact",
|
|
20
|
-
"copilot",
|
|
21
|
-
"customer-stories",
|
|
22
|
-
"dashboard",
|
|
23
|
-
"education",
|
|
24
|
-
"enterprise",
|
|
25
|
-
"events",
|
|
26
|
-
"explore",
|
|
27
|
-
"features",
|
|
28
|
-
"feed",
|
|
29
|
-
"home",
|
|
30
|
-
"issues",
|
|
31
|
-
"join",
|
|
32
|
-
"login",
|
|
33
|
-
"marketplace",
|
|
34
|
-
"new",
|
|
35
|
-
"nonprofit",
|
|
36
|
-
"notifications",
|
|
37
|
-
"organizations",
|
|
38
|
-
"orgs",
|
|
39
|
-
"password_reset",
|
|
40
|
-
"premium-support",
|
|
41
|
-
"pricing",
|
|
42
|
-
"pulls",
|
|
43
|
-
"readme",
|
|
44
|
-
"resources",
|
|
45
|
-
"search",
|
|
46
|
-
"security",
|
|
47
|
-
"sessions",
|
|
48
|
-
"settings",
|
|
49
|
-
"signup",
|
|
50
|
-
"site",
|
|
51
|
-
"sponsors",
|
|
52
|
-
"stars",
|
|
53
|
-
"team",
|
|
54
|
-
"topics",
|
|
55
|
-
"trending",
|
|
56
|
-
"watching"
|
|
57
|
-
];
|
|
58
|
-
const githubHandler = {
|
|
59
|
-
match: (url) => {
|
|
60
|
-
return require_utils.isHostOf(url, hosts);
|
|
61
|
-
},
|
|
62
|
-
resolve: (url) => {
|
|
63
|
-
const { pathname } = new URL(url);
|
|
64
|
-
const uris = [];
|
|
65
|
-
const userMatch = pathname.match(userRegex);
|
|
66
|
-
if (userMatch?.[1] && !require_utils.isAnyOf(userMatch[1], excludedPaths)) return [{
|
|
67
|
-
uri: `https://github.com/${userMatch[1]}.atom`,
|
|
68
|
-
hint: require_utils.composeHint("github:activity")
|
|
69
|
-
}];
|
|
70
|
-
const repoMatch = pathname.match(repoRegex);
|
|
71
|
-
const owner = repoMatch?.[1];
|
|
72
|
-
const repo = repoMatch?.[2];
|
|
73
|
-
if (!owner || !repo || require_utils.isAnyOf(owner, excludedPaths)) return [];
|
|
74
|
-
uris.push({
|
|
75
|
-
uri: `https://github.com/${owner}/${repo}/releases.atom`,
|
|
76
|
-
hint: require_utils.composeHint("github:releases")
|
|
77
|
-
});
|
|
78
|
-
uris.push({
|
|
79
|
-
uri: `https://github.com/${owner}/${repo}/commits.atom`,
|
|
80
|
-
hint: require_utils.composeHint("github:commits")
|
|
81
|
-
});
|
|
82
|
-
uris.push({
|
|
83
|
-
uri: `https://github.com/${owner}/${repo}/tags.atom`,
|
|
84
|
-
hint: require_utils.composeHint("github:tags")
|
|
85
|
-
});
|
|
86
|
-
if (wikiRegex.test(pathname)) uris.push({
|
|
87
|
-
uri: `https://github.com/${owner}/${repo}/wiki.atom`,
|
|
88
|
-
hint: require_utils.composeHint("github:wiki")
|
|
89
|
-
});
|
|
90
|
-
if (discussionsRegex.test(pathname)) uris.push({
|
|
91
|
-
uri: `https://github.com/${owner}/${repo}/discussions.atom`,
|
|
92
|
-
hint: require_utils.composeHint("github:discussions")
|
|
93
|
-
});
|
|
94
|
-
const discussionCategoryMatch = pathname.match(discussionCategoryRegex);
|
|
95
|
-
if (discussionCategoryMatch?.[1]) uris.push({
|
|
96
|
-
uri: `https://github.com/${owner}/${repo}/discussions/categories/${discussionCategoryMatch[1]}.atom`,
|
|
97
|
-
hint: require_utils.composeHint("github:discussion-category")
|
|
98
|
-
});
|
|
99
|
-
const branchMatch = pathname.match(branchRegex);
|
|
100
|
-
if (branchMatch?.[1]) {
|
|
101
|
-
const branch = branchMatch[1];
|
|
102
|
-
uris.push({
|
|
103
|
-
uri: `https://github.com/${owner}/${repo}/commits/${branch}.atom`,
|
|
104
|
-
hint: require_utils.composeHint("github:branch-commits")
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
const fileMatch = pathname.match(fileRegex);
|
|
108
|
-
if (fileMatch?.[1] && fileMatch?.[2]) {
|
|
109
|
-
const branch = fileMatch[1];
|
|
110
|
-
const filePath = fileMatch[2];
|
|
111
|
-
uris.push({
|
|
112
|
-
uri: `https://github.com/${owner}/${repo}/commits/${branch}/${filePath}.atom`,
|
|
113
|
-
hint: require_utils.composeHint("github:file-history")
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
return uris;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
//#endregion
|
|
120
|
-
exports.excludedPaths = excludedPaths;
|
|
121
|
-
exports.githubHandler = githubHandler;
|
|
122
|
-
exports.hosts = hosts;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/githubGist.ts
|
|
3
|
-
const gistRegex = /^\/([^/]+)\/([a-f0-9]+)/;
|
|
4
|
-
const starredRegex = /^\/([^/]+)\/starred\/?$/;
|
|
5
|
-
const forksRegex = /^\/([^/]+)\/forks\/?$/;
|
|
6
|
-
const userRegex = /^\/([^/]+)\/?$/;
|
|
7
|
-
const discoverRegex = /^\/discover\/?$/;
|
|
8
|
-
const hosts = ["gist.github.com"];
|
|
9
|
-
const excludedPaths = [
|
|
10
|
-
"discover",
|
|
11
|
-
"search",
|
|
12
|
-
"login",
|
|
13
|
-
"join",
|
|
14
|
-
"settings"
|
|
15
|
-
];
|
|
16
|
-
const githubGistHandler = {
|
|
17
|
-
match: (url) => {
|
|
18
|
-
return require_utils.isHostOf(url, hosts);
|
|
19
|
-
},
|
|
20
|
-
resolve: (url) => {
|
|
21
|
-
const { pathname } = new URL(url);
|
|
22
|
-
if (discoverRegex.test(pathname)) return [{
|
|
23
|
-
uri: "https://gist.github.com/discover.atom",
|
|
24
|
-
hint: require_utils.composeHint("github-gist:discover")
|
|
25
|
-
}];
|
|
26
|
-
const starredMatch = pathname.match(starredRegex);
|
|
27
|
-
if (starredMatch?.[1] && !require_utils.isAnyOf(starredMatch[1], excludedPaths)) return [{
|
|
28
|
-
uri: `https://gist.github.com/${starredMatch[1]}/starred.atom`,
|
|
29
|
-
hint: require_utils.composeHint("github-gist:starred")
|
|
30
|
-
}];
|
|
31
|
-
const forksMatch = pathname.match(forksRegex);
|
|
32
|
-
if (forksMatch?.[1] && !require_utils.isAnyOf(forksMatch[1], excludedPaths)) return [{
|
|
33
|
-
uri: `https://gist.github.com/${forksMatch[1]}/forks.atom`,
|
|
34
|
-
hint: require_utils.composeHint("github-gist:forks")
|
|
35
|
-
}];
|
|
36
|
-
const gistMatch = pathname.match(gistRegex);
|
|
37
|
-
if (gistMatch?.[1] && gistMatch?.[2]) {
|
|
38
|
-
const username = gistMatch[1];
|
|
39
|
-
if (!require_utils.isAnyOf(username, excludedPaths)) return [{
|
|
40
|
-
uri: `https://gist.github.com/${username}.atom`,
|
|
41
|
-
hint: require_utils.composeHint("github-gist:gists")
|
|
42
|
-
}];
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
const userMatch = pathname.match(userRegex);
|
|
46
|
-
if (userMatch?.[1] && !require_utils.isAnyOf(userMatch[1], excludedPaths)) return [{
|
|
47
|
-
uri: `https://gist.github.com/${userMatch[1]}.atom`,
|
|
48
|
-
hint: require_utils.composeHint("github-gist:gists")
|
|
49
|
-
}];
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
//#endregion
|
|
54
|
-
exports.excludedPaths = excludedPaths;
|
|
55
|
-
exports.githubGistHandler = githubGistHandler;
|
|
56
|
-
exports.hosts = hosts;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/gitlab.ts
|
|
3
|
-
const hosts = ["gitlab.com", "www.gitlab.com"];
|
|
4
|
-
const excludedPaths = [
|
|
5
|
-
"explore",
|
|
6
|
-
"dashboard",
|
|
7
|
-
"projects",
|
|
8
|
-
"groups",
|
|
9
|
-
"search",
|
|
10
|
-
"admin",
|
|
11
|
-
"help",
|
|
12
|
-
"assets",
|
|
13
|
-
"users",
|
|
14
|
-
"api",
|
|
15
|
-
"jwt",
|
|
16
|
-
"oauth",
|
|
17
|
-
"profile",
|
|
18
|
-
"snippets",
|
|
19
|
-
"abuse_reports",
|
|
20
|
-
"invites",
|
|
21
|
-
"import",
|
|
22
|
-
"uploads",
|
|
23
|
-
"robots.txt",
|
|
24
|
-
"sitemap",
|
|
25
|
-
"-"
|
|
26
|
-
];
|
|
27
|
-
const isGitlabHtml = (content) => {
|
|
28
|
-
return require_utils.hasMetaContent(content, "og:site_name", "GitLab");
|
|
29
|
-
};
|
|
30
|
-
const isGitlabHeaders = (headers) => {
|
|
31
|
-
return headers.has("x-gitlab-meta");
|
|
32
|
-
};
|
|
33
|
-
const gitlabHandler = {
|
|
34
|
-
match: (url, content, headers) => {
|
|
35
|
-
if (require_utils.isHostOf(url, hosts)) return true;
|
|
36
|
-
try {
|
|
37
|
-
const { pathname } = new URL(url);
|
|
38
|
-
if (pathname.split("/").filter(Boolean).length === 0) return false;
|
|
39
|
-
if (content && isGitlabHtml(content)) return true;
|
|
40
|
-
if (headers && isGitlabHeaders(headers)) return true;
|
|
41
|
-
} catch {}
|
|
42
|
-
return false;
|
|
43
|
-
},
|
|
44
|
-
resolve: (url) => {
|
|
45
|
-
const { origin, pathname } = new URL(url);
|
|
46
|
-
const pathSegments = pathname.split("/").filter(Boolean);
|
|
47
|
-
if (pathSegments.length === 1) {
|
|
48
|
-
const user = pathSegments[0];
|
|
49
|
-
if (!require_utils.isAnyOf(user, excludedPaths)) return [{
|
|
50
|
-
uri: `${origin}/${user}.atom`,
|
|
51
|
-
hint: require_utils.composeHint("gitlab:activity")
|
|
52
|
-
}];
|
|
53
|
-
}
|
|
54
|
-
if (pathSegments.length >= 2) {
|
|
55
|
-
const user = pathSegments[0];
|
|
56
|
-
const repo = pathSegments[1];
|
|
57
|
-
if (!require_utils.isAnyOf(user, excludedPaths)) {
|
|
58
|
-
const repoFeeds = [
|
|
59
|
-
{
|
|
60
|
-
uri: `${origin}/${user}/${repo}/-/releases.atom`,
|
|
61
|
-
hint: require_utils.composeHint("gitlab:releases")
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
uri: `${origin}/${user}/${repo}/-/tags?format=atom`,
|
|
65
|
-
hint: require_utils.composeHint("gitlab:tags")
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
uri: `${origin}/${user}/${repo}/-/issues.atom`,
|
|
69
|
-
hint: require_utils.composeHint("gitlab:issues")
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
uri: `${origin}/${user}/${repo}/-/merge_requests.atom`,
|
|
73
|
-
hint: require_utils.composeHint("gitlab:merge-requests")
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
uri: `${origin}/${user}/${repo}.atom`,
|
|
77
|
-
hint: require_utils.composeHint("gitlab:activity")
|
|
78
|
-
}
|
|
79
|
-
];
|
|
80
|
-
if (pathSegments[2] === "-" && (pathSegments[3] === "commits" || pathSegments[3] === "tree") && pathSegments[4]) {
|
|
81
|
-
const branch = pathSegments[4];
|
|
82
|
-
repoFeeds.unshift({
|
|
83
|
-
uri: `${origin}/${user}/${repo}/-/commits/${branch}?format=atom`,
|
|
84
|
-
hint: require_utils.composeHint("gitlab:branch-commits")
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return repoFeeds;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return [];
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
exports.excludedPaths = excludedPaths;
|
|
95
|
-
exports.gitlabHandler = gitlabHandler;
|
|
96
|
-
exports.hosts = hosts;
|
|
97
|
-
exports.isGitlabHeaders = isGitlabHeaders;
|
|
98
|
-
exports.isGitlabHtml = isGitlabHtml;
|