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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isAnyOf, isHostOf } from "../../../common/utils.js";
|
|
2
|
+
import { excludedPaths, hosts } from "../../../feeds/platform/handlers/githubGist.js";
|
|
3
|
+
//#region src/favicons/platform/handlers/githubGist.ts
|
|
4
|
+
const githubGistHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isHostOf(url, hosts);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { pathname } = new URL(url);
|
|
10
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
11
|
+
if (segments.length === 0) return [];
|
|
12
|
+
const user = segments[0];
|
|
13
|
+
if (isAnyOf(user, excludedPaths)) return [];
|
|
14
|
+
return [{ uri: `https://github.com/${user}.png` }];
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { githubGistHandler };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
const require_lobsters = require("../../../feeds/platform/handlers/lobsters.cjs");
|
|
3
|
+
//#region src/favicons/platform/handlers/lobsters.ts
|
|
4
|
+
const userPathRegex = /^\/~([a-zA-Z0-9_-]+)/;
|
|
5
|
+
const lobstersHandler = {
|
|
6
|
+
match: (url) => {
|
|
7
|
+
try {
|
|
8
|
+
const { pathname } = new URL(url);
|
|
9
|
+
return require_utils.isHostOf(url, require_lobsters.hosts) && userPathRegex.test(pathname);
|
|
10
|
+
} catch {}
|
|
11
|
+
return false;
|
|
12
|
+
},
|
|
13
|
+
resolve: (url) => {
|
|
14
|
+
const { pathname } = new URL(url);
|
|
15
|
+
const match = pathname.match(userPathRegex);
|
|
16
|
+
if (!match?.[1]) return [];
|
|
17
|
+
return [{ uri: `https://lobste.rs/avatars/${match[1]}-100.png` }];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.lobstersHandler = lobstersHandler;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isHostOf } from "../../../common/utils.js";
|
|
2
|
+
import { hosts } from "../../../feeds/platform/handlers/lobsters.js";
|
|
3
|
+
//#region src/favicons/platform/handlers/lobsters.ts
|
|
4
|
+
const userPathRegex = /^\/~([a-zA-Z0-9_-]+)/;
|
|
5
|
+
const lobstersHandler = {
|
|
6
|
+
match: (url) => {
|
|
7
|
+
try {
|
|
8
|
+
const { pathname } = new URL(url);
|
|
9
|
+
return isHostOf(url, hosts) && userPathRegex.test(pathname);
|
|
10
|
+
} catch {}
|
|
11
|
+
return false;
|
|
12
|
+
},
|
|
13
|
+
resolve: (url) => {
|
|
14
|
+
const { pathname } = new URL(url);
|
|
15
|
+
const match = pathname.match(userPathRegex);
|
|
16
|
+
if (!match?.[1]) return [];
|
|
17
|
+
return [{ uri: `https://lobste.rs/avatars/${match[1]}-100.png` }];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { lobstersHandler };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/favicons/platform/handlers/mastodon.ts
|
|
2
|
+
const isProfilePath = (pathname) => {
|
|
3
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
4
|
+
return segments.length === 1 && segments[0].startsWith("@");
|
|
5
|
+
};
|
|
6
|
+
const isMastodonHtml = (content) => {
|
|
7
|
+
return /<meta[^>]+name=["']generator["'][^>]+content=["']Mastodon/i.test(content);
|
|
8
|
+
};
|
|
9
|
+
const isMastodonHeaders = (headers) => {
|
|
10
|
+
return /mastodon/i.test(headers.get("server") ?? "");
|
|
11
|
+
};
|
|
12
|
+
const mastodonHandler = {
|
|
13
|
+
match: (url, content, headers) => {
|
|
14
|
+
try {
|
|
15
|
+
const { pathname } = new URL(url);
|
|
16
|
+
if (!isProfilePath(pathname)) return false;
|
|
17
|
+
if (content && isMastodonHtml(content)) return true;
|
|
18
|
+
if (headers && isMastodonHeaders(headers)) return true;
|
|
19
|
+
} catch {}
|
|
20
|
+
return false;
|
|
21
|
+
},
|
|
22
|
+
resolve: async (url, _content, _headers, fetchFn) => {
|
|
23
|
+
if (!fetchFn) return [];
|
|
24
|
+
try {
|
|
25
|
+
const { hostname, pathname } = new URL(url);
|
|
26
|
+
const response = await fetchFn(`https://${hostname}/api/v1/accounts/lookup?acct=${pathname.split("/").filter(Boolean)[0].replace("@", "")}`);
|
|
27
|
+
const data = JSON.parse(typeof response.body === "string" ? response.body : "");
|
|
28
|
+
if (typeof data.avatar === "string" && data.avatar.length > 0) return [{ uri: data.avatar }];
|
|
29
|
+
} catch {}
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.isMastodonHeaders = isMastodonHeaders;
|
|
35
|
+
exports.isMastodonHtml = isMastodonHtml;
|
|
36
|
+
exports.mastodonHandler = mastodonHandler;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/favicons/platform/handlers/mastodon.ts
|
|
2
|
+
const isProfilePath = (pathname) => {
|
|
3
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
4
|
+
return segments.length === 1 && segments[0].startsWith("@");
|
|
5
|
+
};
|
|
6
|
+
const isMastodonHtml = (content) => {
|
|
7
|
+
return /<meta[^>]+name=["']generator["'][^>]+content=["']Mastodon/i.test(content);
|
|
8
|
+
};
|
|
9
|
+
const isMastodonHeaders = (headers) => {
|
|
10
|
+
return /mastodon/i.test(headers.get("server") ?? "");
|
|
11
|
+
};
|
|
12
|
+
const mastodonHandler = {
|
|
13
|
+
match: (url, content, headers) => {
|
|
14
|
+
try {
|
|
15
|
+
const { pathname } = new URL(url);
|
|
16
|
+
if (!isProfilePath(pathname)) return false;
|
|
17
|
+
if (content && isMastodonHtml(content)) return true;
|
|
18
|
+
if (headers && isMastodonHeaders(headers)) return true;
|
|
19
|
+
} catch {}
|
|
20
|
+
return false;
|
|
21
|
+
},
|
|
22
|
+
resolve: async (url, _content, _headers, fetchFn) => {
|
|
23
|
+
if (!fetchFn) return [];
|
|
24
|
+
try {
|
|
25
|
+
const { hostname, pathname } = new URL(url);
|
|
26
|
+
const response = await fetchFn(`https://${hostname}/api/v1/accounts/lookup?acct=${pathname.split("/").filter(Boolean)[0].replace("@", "")}`);
|
|
27
|
+
const data = JSON.parse(typeof response.body === "string" ? response.body : "");
|
|
28
|
+
if (typeof data.avatar === "string" && data.avatar.length > 0) return [{ uri: data.avatar }];
|
|
29
|
+
} catch {}
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { isMastodonHeaders, isMastodonHtml, mastodonHandler };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
const require_reddit = require("../../../feeds/platform/handlers/reddit.cjs");
|
|
3
|
+
//#region src/favicons/platform/handlers/reddit.ts
|
|
4
|
+
const isSubredditPath = (pathname) => {
|
|
5
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
6
|
+
return segments.length >= 2 && segments[0] === "r";
|
|
7
|
+
};
|
|
8
|
+
const isUserPath = (pathname) => {
|
|
9
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
10
|
+
return segments.length >= 2 && (segments[0] === "u" || segments[0] === "user");
|
|
11
|
+
};
|
|
12
|
+
const redditHandler = {
|
|
13
|
+
match: (url) => {
|
|
14
|
+
try {
|
|
15
|
+
const { pathname } = new URL(url);
|
|
16
|
+
return require_utils.isHostOf(url, require_reddit.hosts) && (isSubredditPath(pathname) || isUserPath(pathname));
|
|
17
|
+
} catch {}
|
|
18
|
+
return false;
|
|
19
|
+
},
|
|
20
|
+
resolve: async (url, _content, _headers, fetchFn) => {
|
|
21
|
+
if (!fetchFn) return [];
|
|
22
|
+
try {
|
|
23
|
+
const { pathname } = new URL(url);
|
|
24
|
+
if (isSubredditPath(pathname)) {
|
|
25
|
+
const response = await fetchFn(`https://www.reddit.com/r/${pathname.split("/").filter(Boolean)[1]}/about.json`);
|
|
26
|
+
const data = JSON.parse(typeof response.body === "string" ? response.body : "");
|
|
27
|
+
const icon = data?.data?.community_icon?.split("?")[0] || data?.data?.icon_img;
|
|
28
|
+
if (typeof icon === "string" && icon.length > 0) return [{ uri: icon }];
|
|
29
|
+
}
|
|
30
|
+
if (isUserPath(pathname)) {
|
|
31
|
+
const response = await fetchFn(`https://www.reddit.com/user/${pathname.split("/").filter(Boolean)[1]}/about.json`);
|
|
32
|
+
const data = JSON.parse(typeof response.body === "string" ? response.body : "");
|
|
33
|
+
const icon = data?.data?.icon_img || data?.data?.snoovatar_img;
|
|
34
|
+
if (typeof icon === "string" && icon.length > 0) return [{ uri: icon }];
|
|
35
|
+
}
|
|
36
|
+
} catch {}
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.redditHandler = redditHandler;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isHostOf } from "../../../common/utils.js";
|
|
2
|
+
import { hosts } from "../../../feeds/platform/handlers/reddit.js";
|
|
3
|
+
//#region src/favicons/platform/handlers/reddit.ts
|
|
4
|
+
const isSubredditPath = (pathname) => {
|
|
5
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
6
|
+
return segments.length >= 2 && segments[0] === "r";
|
|
7
|
+
};
|
|
8
|
+
const isUserPath = (pathname) => {
|
|
9
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
10
|
+
return segments.length >= 2 && (segments[0] === "u" || segments[0] === "user");
|
|
11
|
+
};
|
|
12
|
+
const redditHandler = {
|
|
13
|
+
match: (url) => {
|
|
14
|
+
try {
|
|
15
|
+
const { pathname } = new URL(url);
|
|
16
|
+
return isHostOf(url, hosts) && (isSubredditPath(pathname) || isUserPath(pathname));
|
|
17
|
+
} catch {}
|
|
18
|
+
return false;
|
|
19
|
+
},
|
|
20
|
+
resolve: async (url, _content, _headers, fetchFn) => {
|
|
21
|
+
if (!fetchFn) return [];
|
|
22
|
+
try {
|
|
23
|
+
const { pathname } = new URL(url);
|
|
24
|
+
if (isSubredditPath(pathname)) {
|
|
25
|
+
const response = await fetchFn(`https://www.reddit.com/r/${pathname.split("/").filter(Boolean)[1]}/about.json`);
|
|
26
|
+
const data = JSON.parse(typeof response.body === "string" ? response.body : "");
|
|
27
|
+
const icon = data?.data?.community_icon?.split("?")[0] || data?.data?.icon_img;
|
|
28
|
+
if (typeof icon === "string" && icon.length > 0) return [{ uri: icon }];
|
|
29
|
+
}
|
|
30
|
+
if (isUserPath(pathname)) {
|
|
31
|
+
const response = await fetchFn(`https://www.reddit.com/user/${pathname.split("/").filter(Boolean)[1]}/about.json`);
|
|
32
|
+
const data = JSON.parse(typeof response.body === "string" ? response.body : "");
|
|
33
|
+
const icon = data?.data?.icon_img || data?.data?.snoovatar_img;
|
|
34
|
+
if (typeof icon === "string" && icon.length > 0) return [{ uri: icon }];
|
|
35
|
+
}
|
|
36
|
+
} catch {}
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { redditHandler };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
const require_sourceforge = require("../../../feeds/platform/handlers/sourceforge.cjs");
|
|
3
|
+
//#region src/favicons/platform/handlers/sourceforge.ts
|
|
4
|
+
const sourceforgeHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
try {
|
|
7
|
+
const { pathname } = new URL(url);
|
|
8
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
9
|
+
return require_utils.isHostOf(url, require_sourceforge.hosts) && segments[0] === "projects" && !!segments[1];
|
|
10
|
+
} catch {}
|
|
11
|
+
return false;
|
|
12
|
+
},
|
|
13
|
+
resolve: (url) => {
|
|
14
|
+
const { pathname } = new URL(url);
|
|
15
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
16
|
+
if (segments[0] !== "projects" || !segments[1]) return [];
|
|
17
|
+
return [{ uri: `https://a.fsdn.com/allura/p/${segments[1]}/icon` }];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.sourceforgeHandler = sourceforgeHandler;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isHostOf } from "../../../common/utils.js";
|
|
2
|
+
import { hosts } from "../../../feeds/platform/handlers/sourceforge.js";
|
|
3
|
+
//#region src/favicons/platform/handlers/sourceforge.ts
|
|
4
|
+
const sourceforgeHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
try {
|
|
7
|
+
const { pathname } = new URL(url);
|
|
8
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
9
|
+
return isHostOf(url, hosts) && segments[0] === "projects" && !!segments[1];
|
|
10
|
+
} catch {}
|
|
11
|
+
return false;
|
|
12
|
+
},
|
|
13
|
+
resolve: (url) => {
|
|
14
|
+
const { pathname } = new URL(url);
|
|
15
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
16
|
+
if (segments[0] !== "projects" || !segments[1]) return [];
|
|
17
|
+
return [{ uri: `https://a.fsdn.com/allura/p/${segments[1]}/icon` }];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { sourceforgeHandler };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
+
const require_tumblr = require("../../../feeds/platform/handlers/tumblr.cjs");
|
|
3
|
+
//#region src/favicons/platform/handlers/tumblr.ts
|
|
4
|
+
const tumblrHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return require_utils.isSubdomainOf(url, require_tumblr.domains);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { hostname } = new URL(url);
|
|
10
|
+
const blog = hostname.split(".")[0];
|
|
11
|
+
if (!blog || blog === "www") return [];
|
|
12
|
+
return [{ uri: `https://api.tumblr.com/v2/blog/${blog}/avatar/512` }];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.tumblrHandler = tumblrHandler;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isSubdomainOf } from "../../../common/utils.js";
|
|
2
|
+
import { domains } from "../../../feeds/platform/handlers/tumblr.js";
|
|
3
|
+
//#region src/favicons/platform/handlers/tumblr.ts
|
|
4
|
+
const tumblrHandler = {
|
|
5
|
+
match: (url) => {
|
|
6
|
+
return isSubdomainOf(url, domains);
|
|
7
|
+
},
|
|
8
|
+
resolve: (url) => {
|
|
9
|
+
const { hostname } = new URL(url);
|
|
10
|
+
const blog = hostname.split(".")[0];
|
|
11
|
+
if (!blog || blog === "www") return [];
|
|
12
|
+
return [{ uri: `https://api.tumblr.com/v2/blog/${blog}/avatar/512` }];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { tumblrHandler };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_defaults = require("./favicons/defaults.cjs");
|
|
3
|
+
const require_extractors = require("./favicons/extractors.cjs");
|
|
4
|
+
exports.defaultExtractor = require_extractors.defaultExtractor;
|
|
5
|
+
exports.defaultFeedOptions = require_defaults.defaultFeedOptions;
|
|
6
|
+
exports.defaultGuessOptions = require_defaults.defaultGuessOptions;
|
|
7
|
+
exports.defaultGuessPaths = require_defaults.defaultGuessPaths;
|
|
8
|
+
exports.defaultHeadersOptions = require_defaults.defaultHeadersOptions;
|
|
9
|
+
exports.defaultHtmlOptions = require_defaults.defaultHtmlOptions;
|
|
10
|
+
exports.defaultIconRels = require_defaults.defaultIconRels;
|
|
11
|
+
exports.defaultPlatformOptions = require_defaults.defaultPlatformOptions;
|
|
12
|
+
exports.linkSelectors = require_defaults.linkSelectors;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultFeedOptions, defaultGuessOptions, defaultGuessPaths, defaultHeadersOptions, defaultHtmlOptions, defaultIconRels, defaultPlatformOptions, linkSelectors } from "./favicons/defaults.cjs";
|
|
2
|
+
import { FaviconResult } from "./favicons/types.cjs";
|
|
3
|
+
import { defaultExtractor } from "./favicons/extractors.cjs";
|
|
4
|
+
export { FaviconResult, defaultExtractor, defaultFeedOptions, defaultGuessOptions, defaultGuessPaths, defaultHeadersOptions, defaultHtmlOptions, defaultIconRels, defaultPlatformOptions, linkSelectors };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultFeedOptions, defaultGuessOptions, defaultGuessPaths, defaultHeadersOptions, defaultHtmlOptions, defaultIconRels, defaultPlatformOptions, linkSelectors } from "./favicons/defaults.js";
|
|
2
|
+
import { FaviconResult } from "./favicons/types.js";
|
|
3
|
+
import { defaultExtractor } from "./favicons/extractors.js";
|
|
4
|
+
export { FaviconResult, defaultExtractor, defaultFeedOptions, defaultGuessOptions, defaultGuessPaths, defaultHeadersOptions, defaultHtmlOptions, defaultIconRels, defaultPlatformOptions, linkSelectors };
|
package/dist/favicons.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { defaultFeedOptions, defaultGuessOptions, defaultGuessPaths, defaultHeadersOptions, defaultHtmlOptions, defaultIconRels, defaultPlatformOptions, linkSelectors } from "./favicons/defaults.js";
|
|
2
|
+
import { defaultExtractor } from "./favicons/extractors.js";
|
|
3
|
+
export { defaultExtractor, defaultFeedOptions, defaultGuessOptions, defaultGuessPaths, defaultHeadersOptions, defaultHtmlOptions, defaultIconRels, defaultPlatformOptions, linkSelectors };
|
package/dist/feeds/defaults.cjs
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
1
|
+
const require_codeberg = require("./platform/handlers/codeberg.cjs");
|
|
2
|
+
const require_deviantart = require("./platform/handlers/deviantart.cjs");
|
|
3
|
+
const require_github = require("./platform/handlers/github.cjs");
|
|
4
|
+
const require_githubGist = require("./platform/handlers/githubGist.cjs");
|
|
5
|
+
const require_lobsters = require("./platform/handlers/lobsters.cjs");
|
|
6
|
+
const require_reddit = require("./platform/handlers/reddit.cjs");
|
|
7
|
+
const require_sourceforge = require("./platform/handlers/sourceforge.cjs");
|
|
8
|
+
const require_tumblr = require("./platform/handlers/tumblr.cjs");
|
|
9
|
+
const require_behance = require("./platform/handlers/behance.cjs");
|
|
10
|
+
const require_blogspot = require("./platform/handlers/blogspot.cjs");
|
|
11
|
+
const require_bluesky = require("./platform/handlers/bluesky.cjs");
|
|
12
|
+
const require_csdn = require("./platform/handlers/csdn.cjs");
|
|
13
|
+
const require_dailymotion = require("./platform/handlers/dailymotion.cjs");
|
|
14
|
+
const require_devto = require("./platform/handlers/devto.cjs");
|
|
15
|
+
const require_douban = require("./platform/handlers/douban.cjs");
|
|
16
|
+
const require_gitlab = require("./platform/handlers/gitlab.cjs");
|
|
17
|
+
const require_goodreads = require("./platform/handlers/goodreads.cjs");
|
|
18
|
+
const require_hashnode = require("./platform/handlers/hashnode.cjs");
|
|
19
|
+
const require_hatenablog = require("./platform/handlers/hatenablog.cjs");
|
|
20
|
+
const require_itchio = require("./platform/handlers/itchio.cjs");
|
|
21
|
+
const require_kickstarter = require("./platform/handlers/kickstarter.cjs");
|
|
22
|
+
const require_letterboxd = require("./platform/handlers/letterboxd.cjs");
|
|
23
|
+
const require_mastodon = require("./platform/handlers/mastodon.cjs");
|
|
24
|
+
const require_medium = require("./platform/handlers/medium.cjs");
|
|
25
|
+
const require_paragraph = require("./platform/handlers/paragraph.cjs");
|
|
26
|
+
const require_pinterest = require("./platform/handlers/pinterest.cjs");
|
|
27
|
+
const require_producthunt = require("./platform/handlers/producthunt.cjs");
|
|
28
|
+
const require_soundcloud = require("./platform/handlers/soundcloud.cjs");
|
|
29
|
+
const require_stackExchange = require("./platform/handlers/stackExchange.cjs");
|
|
30
|
+
const require_steam = require("./platform/handlers/steam.cjs");
|
|
31
|
+
const require_substack = require("./platform/handlers/substack.cjs");
|
|
32
|
+
const require_v2ex = require("./platform/handlers/v2ex.cjs");
|
|
33
|
+
const require_vimeo = require("./platform/handlers/vimeo.cjs");
|
|
34
|
+
const require_wordpress = require("./platform/handlers/wordpress.cjs");
|
|
35
|
+
const require_wpengine = require("./platform/handlers/wpengine.cjs");
|
|
36
|
+
const require_ximalaya = require("./platform/handlers/ximalaya.cjs");
|
|
37
|
+
const require_youtube = require("./platform/handlers/youtube.cjs");
|
|
23
38
|
//#region src/feeds/defaults.ts
|
|
24
39
|
const mimeTypes = [
|
|
25
40
|
"application/rss+xml",
|
|
@@ -110,26 +125,41 @@ const defaultPlatformOptions = { handlers: [
|
|
|
110
125
|
require_behance.behanceHandler,
|
|
111
126
|
require_blogspot.blogspotHandler,
|
|
112
127
|
require_bluesky.blueskyHandler,
|
|
128
|
+
require_csdn.csdnHandler,
|
|
129
|
+
require_codeberg.codebergHandler,
|
|
130
|
+
require_douban.doubanHandler,
|
|
113
131
|
require_deviantart.deviantartHandler,
|
|
114
132
|
require_dailymotion.dailymotionHandler,
|
|
115
133
|
require_devto.devtoHandler,
|
|
134
|
+
require_goodreads.goodreadsHandler,
|
|
116
135
|
require_github.githubHandler,
|
|
136
|
+
require_hashnode.hashnodeHandler,
|
|
137
|
+
require_hatenablog.hatenablogHandler,
|
|
117
138
|
require_githubGist.githubGistHandler,
|
|
118
139
|
require_gitlab.gitlabHandler,
|
|
140
|
+
require_itchio.itchioHandler,
|
|
119
141
|
require_kickstarter.kickstarterHandler,
|
|
142
|
+
require_letterboxd.letterboxdHandler,
|
|
143
|
+
require_lobsters.lobstersHandler,
|
|
144
|
+
require_mastodon.mastodonHandler,
|
|
120
145
|
require_medium.mediumHandler,
|
|
146
|
+
require_paragraph.paragraphHandler,
|
|
121
147
|
require_pinterest.pinterestHandler,
|
|
122
148
|
require_producthunt.producthuntHandler,
|
|
123
|
-
require_lobsters.lobstersHandler,
|
|
124
149
|
require_reddit.redditHandler,
|
|
125
150
|
require_soundcloud.soundcloudHandler,
|
|
151
|
+
require_sourceforge.sourceforgeHandler,
|
|
152
|
+
require_stackExchange.stackExchangeHandler,
|
|
153
|
+
require_steam.steamHandler,
|
|
126
154
|
require_substack.substackHandler,
|
|
127
155
|
require_tumblr.tumblrHandler,
|
|
156
|
+
require_v2ex.v2exHandler,
|
|
157
|
+
require_vimeo.vimeoHandler,
|
|
128
158
|
require_wordpress.wordpressHandler,
|
|
129
159
|
require_wpengine.wpengineHandler,
|
|
160
|
+
require_ximalaya.ximalayaHandler,
|
|
130
161
|
require_youtube.youtubeHandler
|
|
131
162
|
] };
|
|
132
|
-
|
|
133
163
|
//#endregion
|
|
134
164
|
exports.anchorLabels = anchorLabels;
|
|
135
165
|
exports.defaultGuessOptions = defaultGuessOptions;
|
|
@@ -141,4 +171,4 @@ exports.linkSelectors = linkSelectors;
|
|
|
141
171
|
exports.mimeTypes = mimeTypes;
|
|
142
172
|
exports.urisBalanced = urisBalanced;
|
|
143
173
|
exports.urisComprehensive = urisComprehensive;
|
|
144
|
-
exports.urisMinimal = urisMinimal;
|
|
174
|
+
exports.urisMinimal = urisMinimal;
|
package/dist/feeds/defaults.js
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
|
+
import { codebergHandler } from "./platform/handlers/codeberg.js";
|
|
2
|
+
import { deviantartHandler } from "./platform/handlers/deviantart.js";
|
|
3
|
+
import { githubHandler } from "./platform/handlers/github.js";
|
|
4
|
+
import { githubGistHandler } from "./platform/handlers/githubGist.js";
|
|
5
|
+
import { lobstersHandler } from "./platform/handlers/lobsters.js";
|
|
6
|
+
import { redditHandler } from "./platform/handlers/reddit.js";
|
|
7
|
+
import { sourceforgeHandler } from "./platform/handlers/sourceforge.js";
|
|
8
|
+
import { tumblrHandler } from "./platform/handlers/tumblr.js";
|
|
1
9
|
import { behanceHandler } from "./platform/handlers/behance.js";
|
|
2
10
|
import { blogspotHandler } from "./platform/handlers/blogspot.js";
|
|
3
11
|
import { blueskyHandler } from "./platform/handlers/bluesky.js";
|
|
12
|
+
import { csdnHandler } from "./platform/handlers/csdn.js";
|
|
4
13
|
import { dailymotionHandler } from "./platform/handlers/dailymotion.js";
|
|
5
|
-
import { deviantartHandler } from "./platform/handlers/deviantart.js";
|
|
6
14
|
import { devtoHandler } from "./platform/handlers/devto.js";
|
|
7
|
-
import {
|
|
8
|
-
import { githubGistHandler } from "./platform/handlers/githubGist.js";
|
|
15
|
+
import { doubanHandler } from "./platform/handlers/douban.js";
|
|
9
16
|
import { gitlabHandler } from "./platform/handlers/gitlab.js";
|
|
17
|
+
import { goodreadsHandler } from "./platform/handlers/goodreads.js";
|
|
18
|
+
import { hashnodeHandler } from "./platform/handlers/hashnode.js";
|
|
19
|
+
import { hatenablogHandler } from "./platform/handlers/hatenablog.js";
|
|
20
|
+
import { itchioHandler } from "./platform/handlers/itchio.js";
|
|
10
21
|
import { kickstarterHandler } from "./platform/handlers/kickstarter.js";
|
|
11
|
-
import {
|
|
22
|
+
import { letterboxdHandler } from "./platform/handlers/letterboxd.js";
|
|
23
|
+
import { mastodonHandler } from "./platform/handlers/mastodon.js";
|
|
12
24
|
import { mediumHandler } from "./platform/handlers/medium.js";
|
|
25
|
+
import { paragraphHandler } from "./platform/handlers/paragraph.js";
|
|
13
26
|
import { pinterestHandler } from "./platform/handlers/pinterest.js";
|
|
14
27
|
import { producthuntHandler } from "./platform/handlers/producthunt.js";
|
|
15
|
-
import { redditHandler } from "./platform/handlers/reddit.js";
|
|
16
28
|
import { soundcloudHandler } from "./platform/handlers/soundcloud.js";
|
|
29
|
+
import { stackExchangeHandler } from "./platform/handlers/stackExchange.js";
|
|
30
|
+
import { steamHandler } from "./platform/handlers/steam.js";
|
|
17
31
|
import { substackHandler } from "./platform/handlers/substack.js";
|
|
18
|
-
import {
|
|
32
|
+
import { v2exHandler } from "./platform/handlers/v2ex.js";
|
|
33
|
+
import { vimeoHandler } from "./platform/handlers/vimeo.js";
|
|
19
34
|
import { wordpressHandler } from "./platform/handlers/wordpress.js";
|
|
20
35
|
import { wpengineHandler } from "./platform/handlers/wpengine.js";
|
|
36
|
+
import { ximalayaHandler } from "./platform/handlers/ximalaya.js";
|
|
21
37
|
import { youtubeHandler } from "./platform/handlers/youtube.js";
|
|
22
|
-
|
|
23
38
|
//#region src/feeds/defaults.ts
|
|
24
39
|
const mimeTypes = [
|
|
25
40
|
"application/rss+xml",
|
|
@@ -110,25 +125,40 @@ const defaultPlatformOptions = { handlers: [
|
|
|
110
125
|
behanceHandler,
|
|
111
126
|
blogspotHandler,
|
|
112
127
|
blueskyHandler,
|
|
128
|
+
csdnHandler,
|
|
129
|
+
codebergHandler,
|
|
130
|
+
doubanHandler,
|
|
113
131
|
deviantartHandler,
|
|
114
132
|
dailymotionHandler,
|
|
115
133
|
devtoHandler,
|
|
134
|
+
goodreadsHandler,
|
|
116
135
|
githubHandler,
|
|
136
|
+
hashnodeHandler,
|
|
137
|
+
hatenablogHandler,
|
|
117
138
|
githubGistHandler,
|
|
118
139
|
gitlabHandler,
|
|
140
|
+
itchioHandler,
|
|
119
141
|
kickstarterHandler,
|
|
142
|
+
letterboxdHandler,
|
|
143
|
+
lobstersHandler,
|
|
144
|
+
mastodonHandler,
|
|
120
145
|
mediumHandler,
|
|
146
|
+
paragraphHandler,
|
|
121
147
|
pinterestHandler,
|
|
122
148
|
producthuntHandler,
|
|
123
|
-
lobstersHandler,
|
|
124
149
|
redditHandler,
|
|
125
150
|
soundcloudHandler,
|
|
151
|
+
sourceforgeHandler,
|
|
152
|
+
stackExchangeHandler,
|
|
153
|
+
steamHandler,
|
|
126
154
|
substackHandler,
|
|
127
155
|
tumblrHandler,
|
|
156
|
+
v2exHandler,
|
|
157
|
+
vimeoHandler,
|
|
128
158
|
wordpressHandler,
|
|
129
159
|
wpengineHandler,
|
|
160
|
+
ximalayaHandler,
|
|
130
161
|
youtubeHandler
|
|
131
162
|
] };
|
|
132
|
-
|
|
133
163
|
//#endregion
|
|
134
|
-
export { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
164
|
+
export { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
let feedsmith = require("feedsmith");
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/extractors.ts
|
|
4
3
|
const getLinkOfType = (links, rel) => {
|
|
5
4
|
return links?.find((link) => link.rel === rel);
|
|
@@ -41,6 +40,5 @@ const defaultExtractor = async ({ content, url }) => {
|
|
|
41
40
|
isValid: false
|
|
42
41
|
};
|
|
43
42
|
};
|
|
44
|
-
|
|
45
43
|
//#endregion
|
|
46
|
-
exports.defaultExtractor = defaultExtractor;
|
|
44
|
+
exports.defaultExtractor = defaultExtractor;
|
package/dist/feeds/extractors.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { parseFeed } from "feedsmith";
|
|
2
|
-
|
|
3
2
|
//#region src/feeds/extractors.ts
|
|
4
3
|
const getLinkOfType = (links, rel) => {
|
|
5
4
|
return links?.find((link) => link.rel === rel);
|
|
@@ -41,6 +40,5 @@ const defaultExtractor = async ({ content, url }) => {
|
|
|
41
40
|
isValid: false
|
|
42
41
|
};
|
|
43
42
|
};
|
|
44
|
-
|
|
45
43
|
//#endregion
|
|
46
|
-
export { defaultExtractor };
|
|
44
|
+
export { defaultExtractor };
|
package/dist/feeds/index.cjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
const require_utils = require(
|
|
2
|
-
const require_utils$1 = require(
|
|
3
|
-
const require_index = require(
|
|
4
|
-
const require_defaults = require(
|
|
5
|
-
const require_extractors = require(
|
|
6
|
-
|
|
1
|
+
const require_utils = require("../common/utils.cjs");
|
|
2
|
+
const require_utils$1 = require("../common/discover/utils.cjs");
|
|
3
|
+
const require_index = require("../common/discover/index.cjs");
|
|
4
|
+
const require_defaults = require("./defaults.cjs");
|
|
5
|
+
const require_extractors = require("./extractors.cjs");
|
|
7
6
|
//#region src/feeds/index.ts
|
|
8
7
|
const discoverFeeds = async (input, options = {}) => {
|
|
9
8
|
return require_index.discover(input, {
|
|
@@ -24,6 +23,5 @@ const discoverFeeds = async (input, options = {}) => {
|
|
|
24
23
|
guess: require_defaults.defaultGuessOptions
|
|
25
24
|
});
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
|
-
exports.discoverFeeds = discoverFeeds;
|
|
27
|
+
exports.discoverFeeds = discoverFeeds;
|
package/dist/feeds/index.d.cts
CHANGED
|
@@ -2,6 +2,6 @@ import { DiscoverInput, DiscoverOptions, DiscoverResult } from "../common/types.
|
|
|
2
2
|
import { FeedResult } from "./types.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/feeds/index.d.ts
|
|
5
|
-
declare const discoverFeeds: <TValid extends FeedResult = FeedResult>(input: DiscoverInput, options?: DiscoverOptions<TValid>) => Promise<Array<DiscoverResult<TValid>>>;
|
|
5
|
+
declare const discoverFeeds: <TValid extends FeedResult = FeedResult>(input: DiscoverInput, options?: DiscoverOptions<TValid, "platform" | "html" | "headers" | "guess">) => Promise<Array<DiscoverResult<TValid>>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { discoverFeeds };
|
package/dist/feeds/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { DiscoverInput, DiscoverOptions, DiscoverResult } from "../common/types.
|
|
|
2
2
|
import { FeedResult } from "./types.js";
|
|
3
3
|
|
|
4
4
|
//#region src/feeds/index.d.ts
|
|
5
|
-
declare const discoverFeeds: <TValid extends FeedResult = FeedResult>(input: DiscoverInput, options?: DiscoverOptions<TValid>) => Promise<Array<DiscoverResult<TValid>>>;
|
|
5
|
+
declare const discoverFeeds: <TValid extends FeedResult = FeedResult>(input: DiscoverInput, options?: DiscoverOptions<TValid, "platform" | "html" | "headers" | "guess">) => Promise<Array<DiscoverResult<TValid>>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { discoverFeeds };
|
package/dist/feeds/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import { defaultFetchFn } from "../common/discover/utils.js";
|
|
|
3
3
|
import { discover } from "../common/discover/index.js";
|
|
4
4
|
import { defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions } from "./defaults.js";
|
|
5
5
|
import { defaultExtractor } from "./extractors.js";
|
|
6
|
-
|
|
7
6
|
//#region src/feeds/index.ts
|
|
8
7
|
const discoverFeeds = async (input, options = {}) => {
|
|
9
8
|
return discover(input, {
|
|
@@ -24,6 +23,5 @@ const discoverFeeds = async (input, options = {}) => {
|
|
|
24
23
|
guess: defaultGuessOptions
|
|
25
24
|
});
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
|
-
export { discoverFeeds };
|
|
27
|
+
export { discoverFeeds };
|