feedscout 2.0.0-next.2 → 2.0.0-rc.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.
Files changed (190) hide show
  1. package/README.md +1 -1
  2. package/dist/blogrolls.d.ts +4 -4
  3. package/dist/blogrolls.js +3 -3
  4. package/dist/favicons.d.ts +3 -3
  5. package/dist/favicons.js +2 -2
  6. package/dist/feeds.d.ts +4 -4
  7. package/dist/feeds.js +3 -3
  8. package/dist/hubs.d.ts +1 -1
  9. package/dist/index.d.ts +7 -7
  10. package/dist/index.js +6 -6
  11. package/dist/methods.d.ts +7 -7
  12. package/dist/methods.js +7 -7
  13. package/dist/node_modules/trousse/dist/arrays.js +9 -0
  14. package/dist/node_modules/trousse/dist/is.js +19 -0
  15. package/dist/node_modules/trousse/dist/matching.js +37 -0
  16. package/dist/node_modules/trousse/dist/urls.js +23 -0
  17. package/dist/{blogrolls → src/blogrolls}/defaults.d.ts +1 -2
  18. package/dist/{blogrolls → src/blogrolls}/defaults.js +19 -11
  19. package/dist/{blogrolls → src/blogrolls}/extractors.js +3 -2
  20. package/dist/{common → src/common}/discover/defaults.js +1 -3
  21. package/dist/{common → src/common}/discover/index.js +23 -10
  22. package/dist/{common → src/common}/discover/utils.js +10 -3
  23. package/dist/src/common/locales.js +337 -0
  24. package/dist/{common → src/common}/types.d.ts +9 -1
  25. package/dist/{common → src/common}/uris/feed/index.js +1 -1
  26. package/dist/src/common/uris/guess/index.js +16 -0
  27. package/dist/{common → src/common}/uris/guess/types.d.ts +3 -0
  28. package/dist/{common → src/common}/uris/guess/utils.d.ts +2 -1
  29. package/dist/src/common/uris/guess/utils.js +83 -0
  30. package/dist/src/common/uris/headers/index.js +14 -0
  31. package/dist/{common → src/common}/uris/html/handlers.js +18 -1
  32. package/dist/{common → src/common}/uris/html/index.js +17 -1
  33. package/dist/src/common/uris/html/types.d.ts +14 -0
  34. package/dist/src/common/utils.js +51 -0
  35. package/dist/{favicons → src/favicons}/defaults.js +1 -1
  36. package/dist/{favicons → src/favicons}/extractors.js +3 -8
  37. package/dist/{favicons → src/favicons}/platform/handlers/bluesky.js +3 -2
  38. package/dist/{favicons → src/favicons}/platform/handlers/codeberg.js +2 -1
  39. package/dist/{favicons → src/favicons}/platform/handlers/deviantart.js +2 -1
  40. package/dist/{favicons → src/favicons}/platform/handlers/devto.js +4 -2
  41. package/dist/{favicons → src/favicons}/platform/handlers/github.js +2 -1
  42. package/dist/{favicons → src/favicons}/platform/handlers/githubGist.js +2 -1
  43. package/dist/{favicons → src/favicons}/platform/handlers/gitlab.js +4 -2
  44. package/dist/{favicons → src/favicons}/platform/handlers/lobsters.js +1 -1
  45. package/dist/{favicons → src/favicons}/platform/handlers/mastodon.js +2 -1
  46. package/dist/{favicons → src/favicons}/platform/handlers/reddit.js +3 -2
  47. package/dist/{favicons → src/favicons}/platform/handlers/sourceforge.js +1 -1
  48. package/dist/{favicons → src/favicons}/platform/handlers/tumblr.js +1 -1
  49. package/dist/{favicons → src/favicons}/utils.js +1 -4
  50. package/dist/{feeds → src/feeds}/defaults.d.ts +6 -3
  51. package/dist/src/feeds/defaults.js +300 -0
  52. package/dist/{feeds → src/feeds}/extractors.js +3 -2
  53. package/dist/src/feeds/platform/handlers/acast.js +28 -0
  54. package/dist/src/feeds/platform/handlers/ameblo.js +38 -0
  55. package/dist/{feeds → src/feeds}/platform/handlers/applePodcasts.js +3 -2
  56. package/dist/src/feeds/platform/handlers/arena.js +44 -0
  57. package/dist/src/feeds/platform/handlers/artstation.js +54 -0
  58. package/dist/src/feeds/platform/handlers/audioboom.js +24 -0
  59. package/dist/src/feeds/platform/handlers/bearblog.js +46 -0
  60. package/dist/{feeds → src/feeds}/platform/handlers/behance.js +10 -1
  61. package/dist/src/feeds/platform/handlers/blogspot.js +72 -0
  62. package/dist/{feeds → src/feeds}/platform/handlers/bluesky.js +2 -1
  63. package/dist/src/feeds/platform/handlers/bookwyrm.js +48 -0
  64. package/dist/src/feeds/platform/handlers/buttondown.js +45 -0
  65. package/dist/src/feeds/platform/handlers/buzzsprout.js +23 -0
  66. package/dist/{feeds → src/feeds}/platform/handlers/codeberg.js +8 -6
  67. package/dist/{feeds → src/feeds}/platform/handlers/csdn.js +2 -1
  68. package/dist/{feeds → src/feeds}/platform/handlers/dailymotion.js +19 -1
  69. package/dist/{feeds → src/feeds}/platform/handlers/deviantart.js +28 -7
  70. package/dist/{feeds → src/feeds}/platform/handlers/devto.js +11 -1
  71. package/dist/src/feeds/platform/handlers/discourse.js +66 -0
  72. package/dist/{feeds → src/feeds}/platform/handlers/douban.js +2 -1
  73. package/dist/src/feeds/platform/handlers/dreamwidth.js +49 -0
  74. package/dist/src/feeds/platform/handlers/exblog.js +36 -0
  75. package/dist/src/feeds/platform/handlers/fireside.js +25 -0
  76. package/dist/src/feeds/platform/handlers/friendica.js +44 -0
  77. package/dist/src/feeds/platform/handlers/ghost.js +31 -0
  78. package/dist/{feeds → src/feeds}/platform/handlers/github.js +9 -1
  79. package/dist/{feeds → src/feeds}/platform/handlers/githubGist.js +19 -6
  80. package/dist/{feeds → src/feeds}/platform/handlers/gitlab.js +34 -14
  81. package/dist/{feeds → src/feeds}/platform/handlers/goodreads.js +20 -9
  82. package/dist/src/feeds/platform/handlers/hackernews.js +22 -0
  83. package/dist/{feeds → src/feeds}/platform/handlers/hashnode.js +3 -2
  84. package/dist/{feeds → src/feeds}/platform/handlers/hatenablog.js +6 -2
  85. package/dist/src/feeds/platform/handlers/hearthis.js +34 -0
  86. package/dist/src/feeds/platform/handlers/heyWorld.js +19 -0
  87. package/dist/src/feeds/platform/handlers/insanejournal.js +70 -0
  88. package/dist/{feeds → src/feeds}/platform/handlers/itchio.js +27 -2
  89. package/dist/{feeds → src/feeds}/platform/handlers/kickstarter.js +2 -1
  90. package/dist/src/feeds/platform/handlers/lemmy.js +88 -0
  91. package/dist/{feeds → src/feeds}/platform/handlers/letterboxd.js +7 -1
  92. package/dist/src/feeds/platform/handlers/libsyn.js +26 -0
  93. package/dist/src/feeds/platform/handlers/listed.js +21 -0
  94. package/dist/src/feeds/platform/handlers/livejournal.js +69 -0
  95. package/dist/{feeds → src/feeds}/platform/handlers/lobsters.js +2 -1
  96. package/dist/{feeds → src/feeds}/platform/handlers/mastodon.js +32 -0
  97. package/dist/src/feeds/platform/handlers/mataroa.js +17 -0
  98. package/dist/{feeds → src/feeds}/platform/handlers/medium.js +5 -3
  99. package/dist/src/feeds/platform/handlers/microblog.js +56 -0
  100. package/dist/src/feeds/platform/handlers/misskey.js +40 -0
  101. package/dist/src/feeds/platform/handlers/myanimelist.js +44 -0
  102. package/dist/src/feeds/platform/handlers/naverBlog.js +22 -0
  103. package/dist/src/feeds/platform/handlers/nebula.js +70 -0
  104. package/dist/src/feeds/platform/handlers/note.js +55 -0
  105. package/dist/src/feeds/platform/handlers/observable.js +35 -0
  106. package/dist/src/feeds/platform/handlers/odysee.js +21 -0
  107. package/dist/src/feeds/platform/handlers/pagecord.js +17 -0
  108. package/dist/{feeds → src/feeds}/platform/handlers/paragraph.js +3 -3
  109. package/dist/src/feeds/platform/handlers/pika.js +36 -0
  110. package/dist/{feeds → src/feeds}/platform/handlers/pinterest.js +16 -1
  111. package/dist/src/feeds/platform/handlers/pixelfed.js +46 -0
  112. package/dist/src/feeds/platform/handlers/pleroma.js +34 -0
  113. package/dist/src/feeds/platform/handlers/podbean.js +30 -0
  114. package/dist/src/feeds/platform/handlers/podigee.js +30 -0
  115. package/dist/src/feeds/platform/handlers/posthaven.js +25 -0
  116. package/dist/{feeds → src/feeds}/platform/handlers/producthunt.js +2 -1
  117. package/dist/src/feeds/platform/handlers/prose.js +27 -0
  118. package/dist/src/feeds/platform/handlers/qiita.js +60 -0
  119. package/dist/src/feeds/platform/handlers/reddit.js +150 -0
  120. package/dist/src/feeds/platform/handlers/rssCom.js +21 -0
  121. package/dist/src/feeds/platform/handlers/seesaa.js +23 -0
  122. package/dist/{feeds → src/feeds}/platform/handlers/soundcloud.js +3 -1
  123. package/dist/src/feeds/platform/handlers/sourceforge.js +53 -0
  124. package/dist/src/feeds/platform/handlers/spreaker.js +22 -0
  125. package/dist/{feeds → src/feeds}/platform/handlers/stackExchange.js +28 -3
  126. package/dist/{feeds → src/feeds}/platform/handlers/steam.js +9 -1
  127. package/dist/{feeds → src/feeds}/platform/handlers/substack.js +2 -1
  128. package/dist/src/feeds/platform/handlers/tildes.js +42 -0
  129. package/dist/src/feeds/platform/handlers/tistory.js +17 -0
  130. package/dist/src/feeds/platform/handlers/transistor.js +30 -0
  131. package/dist/{feeds → src/feeds}/platform/handlers/tumblr.js +2 -1
  132. package/dist/{feeds → src/feeds}/platform/handlers/v2ex.js +2 -1
  133. package/dist/src/feeds/platform/handlers/velog.js +25 -0
  134. package/dist/{feeds → src/feeds}/platform/handlers/vimeo.js +9 -1
  135. package/dist/src/feeds/platform/handlers/weblogLol.js +27 -0
  136. package/dist/src/feeds/platform/handlers/weebly.js +26 -0
  137. package/dist/src/feeds/platform/handlers/wordpress.js +210 -0
  138. package/dist/{feeds → src/feeds}/platform/handlers/wpengine.js +1 -1
  139. package/dist/src/feeds/platform/handlers/writeas.js +53 -0
  140. package/dist/{feeds → src/feeds}/platform/handlers/ximalaya.js +3 -2
  141. package/dist/{feeds → src/feeds}/platform/handlers/youtube.js +6 -2
  142. package/dist/src/feeds/platform/handlers/zenn.js +56 -0
  143. package/package.json +10 -11
  144. package/dist/common/locales.js +0 -133
  145. package/dist/common/uris/guess/index.js +0 -8
  146. package/dist/common/uris/guess/utils.js +0 -40
  147. package/dist/common/uris/headers/index.js +0 -26
  148. package/dist/common/uris/html/types.d.ts +0 -12
  149. package/dist/common/utils.d.ts +0 -10
  150. package/dist/common/utils.js +0 -79
  151. package/dist/feeds/defaults.js +0 -168
  152. package/dist/feeds/platform/handlers/blogspot.js +0 -36
  153. package/dist/feeds/platform/handlers/lemmy.js +0 -46
  154. package/dist/feeds/platform/handlers/reddit.js +0 -74
  155. package/dist/feeds/platform/handlers/sourceforge.js +0 -19
  156. package/dist/feeds/platform/handlers/wordpress.js +0 -64
  157. package/dist/utils.d.ts +0 -2
  158. package/dist/utils.js +0 -2
  159. /package/dist/{blogrolls → src/blogrolls}/extractors.d.ts +0 -0
  160. /package/dist/{blogrolls → src/blogrolls}/index.d.ts +0 -0
  161. /package/dist/{blogrolls → src/blogrolls}/index.js +0 -0
  162. /package/dist/{blogrolls → src/blogrolls}/types.d.ts +0 -0
  163. /package/dist/{common → src/common}/discover/defaults.d.ts +0 -0
  164. /package/dist/{common → src/common}/discover/utils.d.ts +0 -0
  165. /package/dist/{common → src/common}/types.js +0 -0
  166. /package/dist/{common → src/common}/uris/feed/index.d.ts +0 -0
  167. /package/dist/{common → src/common}/uris/feed/types.d.ts +0 -0
  168. /package/dist/{common → src/common}/uris/guess/index.d.ts +0 -0
  169. /package/dist/{common → src/common}/uris/headers/index.d.ts +0 -0
  170. /package/dist/{common → src/common}/uris/headers/types.d.ts +0 -0
  171. /package/dist/{common → src/common}/uris/html/index.d.ts +0 -0
  172. /package/dist/{common → src/common}/uris/index.js +0 -0
  173. /package/dist/{common → src/common}/uris/platform/index.d.ts +0 -0
  174. /package/dist/{common → src/common}/uris/platform/index.js +0 -0
  175. /package/dist/{common → src/common}/uris/platform/types.d.ts +0 -0
  176. /package/dist/{favicons → src/favicons}/defaults.d.ts +0 -0
  177. /package/dist/{favicons → src/favicons}/extractors.d.ts +0 -0
  178. /package/dist/{favicons → src/favicons}/index.d.ts +0 -0
  179. /package/dist/{favicons → src/favicons}/index.js +0 -0
  180. /package/dist/{favicons → src/favicons}/types.d.ts +0 -0
  181. /package/dist/{feeds → src/feeds}/extractors.d.ts +0 -0
  182. /package/dist/{feeds → src/feeds}/index.d.ts +0 -0
  183. /package/dist/{feeds → src/feeds}/index.js +0 -0
  184. /package/dist/{feeds → src/feeds}/types.d.ts +0 -0
  185. /package/dist/{hubs → src/hubs}/discover/index.d.ts +0 -0
  186. /package/dist/{hubs → src/hubs}/discover/index.js +0 -0
  187. /package/dist/{hubs → src/hubs}/discover/types.d.ts +0 -0
  188. /package/dist/{hubs → src/hubs}/feed/index.js +0 -0
  189. /package/dist/{hubs → src/hubs}/headers/index.js +0 -0
  190. /package/dist/{hubs → src/hubs}/html/index.js +0 -0
@@ -1,3 +1,4 @@
1
+ import { isSuccessfulStatus } from "../common/utils.js";
1
2
  //#region src/favicons/extractors.ts
2
3
  const isImageContentType = (headers) => {
3
4
  return headers?.get("content-type")?.startsWith("image/") ?? false;
@@ -8,17 +9,11 @@ const isImageContent = (content) => {
8
9
  const head = trimmed.slice(0, 200);
9
10
  return trimmed.startsWith("<svg") || trimmed.startsWith("<?xml") && head.includes("<svg") || content.slice(1, 4) === "PNG" || content.startsWith("GIF8") || content.startsWith("RIFF") && content.includes("WEBP");
10
11
  };
11
- const isSuccessStatus = (status) => {
12
- return status !== void 0 && status >= 200 && status < 400;
13
- };
14
12
  const defaultExtractFn = (input) => {
15
- if (isImageContentType(input.headers) || isImageContent(input.content) || isSuccessStatus(input.status)) return {
16
- url: input.url,
17
- isValid: true
18
- };
13
+ const isImage = isImageContentType(input.headers) || isImageContent(input.content);
19
14
  return {
20
15
  url: input.url,
21
- isValid: false
16
+ isValid: isImage && isSuccessfulStatus(input.status)
22
17
  };
23
18
  };
24
19
  //#endregion
@@ -1,5 +1,6 @@
1
- import { isHostOf } from "../../../common/utils.js";
2
- import { isNonEmptyString, parseBodyJson } from "../../utils.js";
1
+ import { isNonEmptyString } from "../../../../node_modules/trousse/dist/is.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
3
+ import { parseBodyJson } from "../../utils.js";
3
4
  //#region src/favicons/platform/handlers/bluesky.ts
4
5
  const hosts = ["bsky.app", "www.bsky.app"];
5
6
  const isProfilePath = (pathname) => {
@@ -1,4 +1,5 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
3
  import { excludedPaths, hosts } from "../../../feeds/platform/handlers/codeberg.js";
3
4
  //#region src/favicons/platform/handlers/codeberg.ts
4
5
  const userRegex = /^\/([^/.]+)/;
@@ -1,4 +1,5 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
3
  import { excludedPaths, hosts } from "../../../feeds/platform/handlers/deviantart.js";
3
4
  //#region src/favicons/platform/handlers/deviantart.ts
4
5
  const deviantartHandler = {
@@ -1,5 +1,7 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
2
- import { isNonEmptyString, parseBodyJson } from "../../utils.js";
1
+ import { isNonEmptyString } from "../../../../node_modules/trousse/dist/is.js";
2
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
3
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
4
+ import { parseBodyJson } from "../../utils.js";
3
5
  import { excludedPaths, hosts } from "../../../feeds/platform/handlers/devto.js";
4
6
  //#region src/favicons/platform/handlers/devto.ts
5
7
  const userRegex = /^\/([^/.]+)/;
@@ -1,4 +1,5 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
3
  import { excludedPaths, hosts } from "../../../feeds/platform/handlers/github.js";
3
4
  //#region src/favicons/platform/handlers/github.ts
4
5
  const userRegex = /^\/([^/.]+)/;
@@ -1,4 +1,5 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
3
  import { excludedPaths, hosts } from "../../../feeds/platform/handlers/githubGist.js";
3
4
  //#region src/favicons/platform/handlers/githubGist.ts
4
5
  const userRegex = /^\/([^/.]+)/;
@@ -1,5 +1,7 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
2
- import { isNonEmptyString, parseBodyJson } from "../../utils.js";
1
+ import { isNonEmptyString } from "../../../../node_modules/trousse/dist/is.js";
2
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
3
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
4
+ import { parseBodyJson } from "../../utils.js";
3
5
  import { excludedPaths, hosts, isGitlabHeaders, isGitlabHtml } from "../../../feeds/platform/handlers/gitlab.js";
4
6
  //#region src/favicons/platform/handlers/gitlab.ts
5
7
  const userRegex = /^\/([^/]+?)(?:\.atom)?(?:\/|$)/;
@@ -1,4 +1,4 @@
1
- import { isHostOf } from "../../../common/utils.js";
1
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
2
  import { hosts } from "../../../feeds/platform/handlers/lobsters.js";
3
3
  //#region src/favicons/platform/handlers/lobsters.ts
4
4
  const userRegex = /^\/~([a-zA-Z0-9_-]+)/;
@@ -1,5 +1,6 @@
1
+ import { isNonEmptyString } from "../../../../node_modules/trousse/dist/is.js";
1
2
  import { hasMetaContent } from "../../../common/utils.js";
2
- import { isNonEmptyString, parseBodyJson } from "../../utils.js";
3
+ import { parseBodyJson } from "../../utils.js";
3
4
  //#region src/favicons/platform/handlers/mastodon.ts
4
5
  const mastodonRegex = /mastodon/i;
5
6
  const profileRegex = /^\/@([^/.]+(?:@[^/.]+\.[^/.]+)?)(?:\.rss)?\/?$/;
@@ -1,5 +1,6 @@
1
- import { isHostOf } from "../../../common/utils.js";
2
- import { isNonEmptyString, parseBodyJson } from "../../utils.js";
1
+ import { isNonEmptyString } from "../../../../node_modules/trousse/dist/is.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
3
+ import { parseBodyJson } from "../../utils.js";
3
4
  import { hosts } from "../../../feeds/platform/handlers/reddit.js";
4
5
  //#region src/favicons/platform/handlers/reddit.ts
5
6
  const subredditRegex = /^\/r\/([^/.]+)/;
@@ -1,4 +1,4 @@
1
- import { isHostOf } from "../../../common/utils.js";
1
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
2
  import { hosts } from "../../../feeds/platform/handlers/sourceforge.js";
3
3
  //#region src/favicons/platform/handlers/sourceforge.ts
4
4
  const sourceforgeHandler = {
@@ -1,4 +1,4 @@
1
- import { isSubdomainOf } from "../../../common/utils.js";
1
+ import { isSubdomainOf } from "../../../../node_modules/trousse/dist/urls.js";
2
2
  import { domains } from "../../../feeds/platform/handlers/tumblr.js";
3
3
  //#region src/favicons/platform/handlers/tumblr.ts
4
4
  const tumblrHandler = {
@@ -2,8 +2,5 @@
2
2
  const parseBodyJson = (body) => {
3
3
  return JSON.parse(typeof body === "string" ? body : "");
4
4
  };
5
- const isNonEmptyString = (value) => {
6
- return typeof value === "string" && value.length > 0;
7
- };
8
5
  //#endregion
9
- export { isNonEmptyString, parseBodyJson };
6
+ export { parseBodyJson };
@@ -2,19 +2,22 @@ import { GuessMethodOptions } from "../common/uris/guess/types.js";
2
2
  import { HeadersMethodOptions } from "../common/uris/headers/types.js";
3
3
  import { HtmlMethodOptions } from "../common/uris/html/types.js";
4
4
  import { PlatformMethodOptions } from "../common/uris/platform/types.js";
5
- import { LinkSelector, UriEntry } from "../common/types.js";
5
+ import { LinkSelector, Pattern, UriEntry } from "../common/types.js";
6
6
 
7
7
  //#region src/feeds/defaults.d.ts
8
8
  declare const mimeTypes: string[];
9
9
  declare const urisMinimal: string[];
10
10
  declare const urisBalanced: string[];
11
11
  declare const urisComprehensive: Array<UriEntry>;
12
- declare const ignoredUris: string[];
12
+ declare const ignoredUris: Array<Pattern>;
13
13
  declare const anchorLabels: string[];
14
14
  declare const linkSelectors: Array<LinkSelector>;
15
+ declare const anchorPathSegments: RegExp[];
16
+ declare const anchorAttributes: string[];
15
17
  declare const defaultHtmlOptions: Omit<HtmlMethodOptions, 'baseUrl'>;
16
18
  declare const defaultHeadersOptions: Omit<HeadersMethodOptions, 'baseUrl'>;
19
+ declare const sectionNames: string[];
17
20
  declare const defaultGuessOptions: Omit<GuessMethodOptions, 'baseUrl'>;
18
21
  declare const defaultPlatformOptions: Omit<PlatformMethodOptions, 'baseUrl'>;
19
22
  //#endregion
20
- export { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
23
+ export { anchorAttributes, anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, sectionNames, urisBalanced, urisComprehensive, urisMinimal };
@@ -0,0 +1,300 @@
1
+ import { codebergHandler } from "./platform/handlers/codeberg.js";
2
+ import { deviantartHandler } from "./platform/handlers/deviantart.js";
3
+ import { devtoHandler } from "./platform/handlers/devto.js";
4
+ import { githubHandler } from "./platform/handlers/github.js";
5
+ import { githubGistHandler } from "./platform/handlers/githubGist.js";
6
+ import { gitlabHandler } from "./platform/handlers/gitlab.js";
7
+ import { lobstersHandler } from "./platform/handlers/lobsters.js";
8
+ import { redditHandler } from "./platform/handlers/reddit.js";
9
+ import { sourceforgeHandler } from "./platform/handlers/sourceforge.js";
10
+ import { tumblrHandler } from "./platform/handlers/tumblr.js";
11
+ import { acastHandler } from "./platform/handlers/acast.js";
12
+ import { amebloHandler } from "./platform/handlers/ameblo.js";
13
+ import { applePodcastsHandler } from "./platform/handlers/applePodcasts.js";
14
+ import { arenaHandler } from "./platform/handlers/arena.js";
15
+ import { artstationHandler } from "./platform/handlers/artstation.js";
16
+ import { audioboomHandler } from "./platform/handlers/audioboom.js";
17
+ import { bearblogHandler } from "./platform/handlers/bearblog.js";
18
+ import { behanceHandler } from "./platform/handlers/behance.js";
19
+ import { blogspotHandler } from "./platform/handlers/blogspot.js";
20
+ import { blueskyHandler } from "./platform/handlers/bluesky.js";
21
+ import { bookwyrmHandler } from "./platform/handlers/bookwyrm.js";
22
+ import { buttondownHandler } from "./platform/handlers/buttondown.js";
23
+ import { buzzsproutHandler } from "./platform/handlers/buzzsprout.js";
24
+ import { csdnHandler } from "./platform/handlers/csdn.js";
25
+ import { dailymotionHandler } from "./platform/handlers/dailymotion.js";
26
+ import { discourseHandler } from "./platform/handlers/discourse.js";
27
+ import { doubanHandler } from "./platform/handlers/douban.js";
28
+ import { dreamwidthHandler } from "./platform/handlers/dreamwidth.js";
29
+ import { exblogHandler } from "./platform/handlers/exblog.js";
30
+ import { firesideHandler } from "./platform/handlers/fireside.js";
31
+ import { friendicaHandler } from "./platform/handlers/friendica.js";
32
+ import { ghostHandler } from "./platform/handlers/ghost.js";
33
+ import { goodreadsHandler } from "./platform/handlers/goodreads.js";
34
+ import { hackernewsHandler } from "./platform/handlers/hackernews.js";
35
+ import { hashnodeHandler } from "./platform/handlers/hashnode.js";
36
+ import { hatenablogHandler } from "./platform/handlers/hatenablog.js";
37
+ import { hearthisHandler } from "./platform/handlers/hearthis.js";
38
+ import { heyWorldHandler } from "./platform/handlers/heyWorld.js";
39
+ import { insanejournalHandler } from "./platform/handlers/insanejournal.js";
40
+ import { itchioHandler } from "./platform/handlers/itchio.js";
41
+ import { kickstarterHandler } from "./platform/handlers/kickstarter.js";
42
+ import { lemmyHandler } from "./platform/handlers/lemmy.js";
43
+ import { letterboxdHandler } from "./platform/handlers/letterboxd.js";
44
+ import { libsynHandler } from "./platform/handlers/libsyn.js";
45
+ import { listedHandler } from "./platform/handlers/listed.js";
46
+ import { livejournalHandler } from "./platform/handlers/livejournal.js";
47
+ import { mastodonHandler } from "./platform/handlers/mastodon.js";
48
+ import { mataroaHandler } from "./platform/handlers/mataroa.js";
49
+ import { mediumHandler } from "./platform/handlers/medium.js";
50
+ import { microblogHandler } from "./platform/handlers/microblog.js";
51
+ import { misskeyHandler } from "./platform/handlers/misskey.js";
52
+ import { myanimelistHandler } from "./platform/handlers/myanimelist.js";
53
+ import { naverBlogHandler } from "./platform/handlers/naverBlog.js";
54
+ import { nebulaHandler } from "./platform/handlers/nebula.js";
55
+ import { noteHandler } from "./platform/handlers/note.js";
56
+ import { observableHandler } from "./platform/handlers/observable.js";
57
+ import { odyseeHandler } from "./platform/handlers/odysee.js";
58
+ import { pagecordHandler } from "./platform/handlers/pagecord.js";
59
+ import { paragraphHandler } from "./platform/handlers/paragraph.js";
60
+ import { pikaHandler } from "./platform/handlers/pika.js";
61
+ import { pinterestHandler } from "./platform/handlers/pinterest.js";
62
+ import { pixelfedHandler } from "./platform/handlers/pixelfed.js";
63
+ import { pleromaHandler } from "./platform/handlers/pleroma.js";
64
+ import { podbeanHandler } from "./platform/handlers/podbean.js";
65
+ import { podigeeHandler } from "./platform/handlers/podigee.js";
66
+ import { posthavenHandler } from "./platform/handlers/posthaven.js";
67
+ import { producthuntHandler } from "./platform/handlers/producthunt.js";
68
+ import { proseHandler } from "./platform/handlers/prose.js";
69
+ import { qiitaHandler } from "./platform/handlers/qiita.js";
70
+ import { rssComHandler } from "./platform/handlers/rssCom.js";
71
+ import { seesaaHandler } from "./platform/handlers/seesaa.js";
72
+ import { soundcloudHandler } from "./platform/handlers/soundcloud.js";
73
+ import { spreakerHandler } from "./platform/handlers/spreaker.js";
74
+ import { stackExchangeHandler } from "./platform/handlers/stackExchange.js";
75
+ import { steamHandler } from "./platform/handlers/steam.js";
76
+ import { substackHandler } from "./platform/handlers/substack.js";
77
+ import { tildesHandler } from "./platform/handlers/tildes.js";
78
+ import { tistoryHandler } from "./platform/handlers/tistory.js";
79
+ import { transistorHandler } from "./platform/handlers/transistor.js";
80
+ import { v2exHandler } from "./platform/handlers/v2ex.js";
81
+ import { velogHandler } from "./platform/handlers/velog.js";
82
+ import { vimeoHandler } from "./platform/handlers/vimeo.js";
83
+ import { weblogLolHandler } from "./platform/handlers/weblogLol.js";
84
+ import { weeblyHandler } from "./platform/handlers/weebly.js";
85
+ import { wordpressHandler } from "./platform/handlers/wordpress.js";
86
+ import { wpengineHandler } from "./platform/handlers/wpengine.js";
87
+ import { writeasHandler } from "./platform/handlers/writeas.js";
88
+ import { ximalayaHandler } from "./platform/handlers/ximalaya.js";
89
+ import { youtubeHandler } from "./platform/handlers/youtube.js";
90
+ import { zennHandler } from "./platform/handlers/zenn.js";
91
+ //#region src/feeds/defaults.ts
92
+ const mimeTypes = [
93
+ "application/rss+xml",
94
+ "text/rss+xml",
95
+ "application/x-rss+xml",
96
+ "application/rss",
97
+ "application/atom+xml",
98
+ "text/atom+xml",
99
+ "application/feed+json",
100
+ "application/json",
101
+ "application/rdf+xml",
102
+ "text/rdf+xml",
103
+ "application/atom",
104
+ "application/xml",
105
+ "text/xml"
106
+ ];
107
+ const urisMinimal = [
108
+ "/feed",
109
+ "/rss",
110
+ "/atom.xml",
111
+ "/feed.xml",
112
+ "/rss.xml",
113
+ "/index.xml"
114
+ ];
115
+ const urisBalanced = [
116
+ ...urisMinimal,
117
+ "/feed/",
118
+ "/index.atom",
119
+ "/index.rss",
120
+ "/feed.json"
121
+ ];
122
+ const urisComprehensive = [
123
+ ...urisBalanced,
124
+ "/atom",
125
+ "/rss/",
126
+ "/rss2.xml",
127
+ "/feed.rss",
128
+ "/feed.atom",
129
+ "/feed.rss.xml",
130
+ "/feed.atom.xml",
131
+ ["/feed/atom/", "?feed=atom"],
132
+ ["/feed/rss/", "?feed=rss"],
133
+ ["/feed/rss2/", "?feed=rss2"],
134
+ ["/feed/rdf", "?feed=rdf"],
135
+ ["/feed/rdf/", "?feed=rdf"],
136
+ "/index.rss.xml",
137
+ "/index.atom.xml",
138
+ "?format=rss",
139
+ "?format=atom",
140
+ "?rss=1",
141
+ "?atom=1",
142
+ "/.rss",
143
+ "/f.json",
144
+ "/f.rss",
145
+ "/json",
146
+ "/.feed",
147
+ ["/comments/feed", "?feed=comments-rss2"],
148
+ ["/comments/feed/rss2/", "?feed=comments-rss2"],
149
+ ["/comments/feed/rdf/", "?feed=comments-rdf"],
150
+ ["/comments/feed/atom/", "?feed=comments-atom"],
151
+ "/feeds/posts/default",
152
+ "/feeds/posts/default?alt=rss",
153
+ "/feeds/comments/default"
154
+ ];
155
+ const ignoredUris = [
156
+ "wp-json/oembed/",
157
+ "wp-json/wp/",
158
+ /[?&][^=&]*=(https?:|https?%3a|aHR0c)/i
159
+ ];
160
+ const anchorLabels = [
161
+ "rss",
162
+ "feed",
163
+ "atom",
164
+ "syndicate",
165
+ "syndication",
166
+ "json feed"
167
+ ];
168
+ const linkSelectors = [{
169
+ rel: "alternate",
170
+ types: mimeTypes
171
+ }, { rel: "feed" }];
172
+ const anchorPathSegments = [
173
+ /\/rss\//,
174
+ /\/atom\//,
175
+ /\/feed\//
176
+ ];
177
+ const anchorAttributes = [
178
+ "aria-label",
179
+ "title",
180
+ "data-framer-name"
181
+ ];
182
+ const defaultHtmlOptions = {
183
+ linkSelectors,
184
+ anchorUris: urisComprehensive.flat(),
185
+ anchorPathSegments,
186
+ anchorIgnoredUris: ignoredUris,
187
+ anchorLabels,
188
+ anchorAttributes
189
+ };
190
+ const defaultHeadersOptions = { linkSelectors };
191
+ const sectionNames = [
192
+ "blog",
193
+ "news",
194
+ "posts",
195
+ "articles",
196
+ "writing",
197
+ "notes",
198
+ "journal",
199
+ "podcast",
200
+ "changelog"
201
+ ];
202
+ const defaultGuessOptions = {
203
+ uris: urisBalanced,
204
+ maxAncestorDepth: 2,
205
+ sectionNames
206
+ };
207
+ const defaultPlatformOptions = { handlers: [
208
+ acastHandler,
209
+ amebloHandler,
210
+ applePodcastsHandler,
211
+ arenaHandler,
212
+ artstationHandler,
213
+ audioboomHandler,
214
+ bearblogHandler,
215
+ behanceHandler,
216
+ blogspotHandler,
217
+ blueskyHandler,
218
+ bookwyrmHandler,
219
+ buttondownHandler,
220
+ buzzsproutHandler,
221
+ codebergHandler,
222
+ csdnHandler,
223
+ dailymotionHandler,
224
+ deviantartHandler,
225
+ devtoHandler,
226
+ discourseHandler,
227
+ doubanHandler,
228
+ dreamwidthHandler,
229
+ exblogHandler,
230
+ firesideHandler,
231
+ friendicaHandler,
232
+ ghostHandler,
233
+ githubHandler,
234
+ githubGistHandler,
235
+ gitlabHandler,
236
+ goodreadsHandler,
237
+ hackernewsHandler,
238
+ hashnodeHandler,
239
+ hatenablogHandler,
240
+ hearthisHandler,
241
+ heyWorldHandler,
242
+ insanejournalHandler,
243
+ itchioHandler,
244
+ kickstarterHandler,
245
+ lemmyHandler,
246
+ letterboxdHandler,
247
+ libsynHandler,
248
+ listedHandler,
249
+ livejournalHandler,
250
+ lobstersHandler,
251
+ mastodonHandler,
252
+ mataroaHandler,
253
+ mediumHandler,
254
+ microblogHandler,
255
+ misskeyHandler,
256
+ myanimelistHandler,
257
+ naverBlogHandler,
258
+ nebulaHandler,
259
+ noteHandler,
260
+ observableHandler,
261
+ odyseeHandler,
262
+ pagecordHandler,
263
+ paragraphHandler,
264
+ pikaHandler,
265
+ pinterestHandler,
266
+ pixelfedHandler,
267
+ pleromaHandler,
268
+ podbeanHandler,
269
+ podigeeHandler,
270
+ posthavenHandler,
271
+ producthuntHandler,
272
+ proseHandler,
273
+ qiitaHandler,
274
+ redditHandler,
275
+ rssComHandler,
276
+ seesaaHandler,
277
+ soundcloudHandler,
278
+ sourceforgeHandler,
279
+ spreakerHandler,
280
+ stackExchangeHandler,
281
+ steamHandler,
282
+ substackHandler,
283
+ tildesHandler,
284
+ tistoryHandler,
285
+ transistorHandler,
286
+ tumblrHandler,
287
+ v2exHandler,
288
+ velogHandler,
289
+ vimeoHandler,
290
+ weblogLolHandler,
291
+ weeblyHandler,
292
+ wordpressHandler,
293
+ wpengineHandler,
294
+ writeasHandler,
295
+ ximalayaHandler,
296
+ youtubeHandler,
297
+ zennHandler
298
+ ] };
299
+ //#endregion
300
+ export { anchorAttributes, anchorLabels, anchorPathSegments, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, sectionNames, urisBalanced, urisComprehensive, urisMinimal };
@@ -1,9 +1,10 @@
1
1
  import { getFeedSiteUrl } from "../common/discover/utils.js";
2
2
  import { defaultResolveUrlFn } from "../common/discover/defaults.js";
3
+ import { isSuccessfulStatus } from "../common/utils.js";
3
4
  import { parseFeed } from "feedsmith";
4
5
  //#region src/feeds/extractors.ts
5
- const defaultExtractFn = ({ content, url }) => {
6
- if (!content) return {
6
+ const defaultExtractFn = ({ content, url, status }) => {
7
+ if (!content || !isSuccessfulStatus(status)) return {
7
8
  url,
8
9
  isValid: false
9
10
  };
@@ -0,0 +1,28 @@
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
3
+ import { composeHint } from "../../../common/utils.js";
4
+ //#region src/feeds/platform/handlers/acast.ts
5
+ const hosts = [
6
+ "shows.acast.com",
7
+ "play.acast.com",
8
+ "embed.acast.com"
9
+ ];
10
+ const excludedPaths = ["discover"];
11
+ const acastHandler = {
12
+ match: (url) => {
13
+ return isHostOf(url, hosts);
14
+ },
15
+ resolve: (url) => {
16
+ const { hostname, pathname } = new URL(url);
17
+ const pathSegments = pathname.split("/").filter(Boolean);
18
+ if (pathSegments.length === 0) return [];
19
+ const slug = pathSegments[hostname.toLowerCase() === "play.acast.com" ? 1 : 0];
20
+ if (!slug || isAnyOf(slug, excludedPaths)) return [];
21
+ return [{
22
+ uri: `https://feeds.acast.com/public/shows/${slug}`,
23
+ hint: composeHint("acast:podcast")
24
+ }];
25
+ }
26
+ };
27
+ //#endregion
28
+ export { acastHandler };
@@ -0,0 +1,38 @@
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
3
+ import { composeHint } from "../../../common/utils.js";
4
+ //#region src/feeds/platform/handlers/ameblo.ts
5
+ const hosts = ["ameblo.jp", "www.ameblo.jp"];
6
+ const excludedPaths = [
7
+ "genre",
8
+ "hashtag",
9
+ "search"
10
+ ];
11
+ const amebloHandler = {
12
+ match: (url) => {
13
+ return isHostOf(url, hosts);
14
+ },
15
+ resolve: (url) => {
16
+ const { pathname } = new URL(url);
17
+ const pathSegments = pathname.split("/").filter(Boolean);
18
+ if (pathSegments.length === 0) return [];
19
+ const username = pathSegments[0];
20
+ if (isAnyOf(username, excludedPaths)) return [];
21
+ const uris = [];
22
+ uris.push({
23
+ uri: `https://ameblo.jp/${username}/rss20.xml`,
24
+ hint: composeHint("ameblo:posts-rss")
25
+ });
26
+ uris.push({
27
+ uri: `https://ameblo.jp/${username}/atom.xml`,
28
+ hint: composeHint("ameblo:posts-atom")
29
+ });
30
+ uris.push({
31
+ uri: `https://rssblog.ameba.jp/${username}/rss.html`,
32
+ hint: composeHint("ameblo:posts-rdf")
33
+ });
34
+ return uris;
35
+ }
36
+ };
37
+ //#endregion
38
+ export { amebloHandler };
@@ -1,7 +1,8 @@
1
- import { composeHint, isHostOf } from "../../../common/utils.js";
1
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
+ import { composeHint } from "../../../common/utils.js";
2
3
  //#region src/feeds/platform/handlers/applePodcasts.ts
3
4
  const hosts = ["podcasts.apple.com"];
4
- const podcastRegex = /^\/[a-z]{2}\/podcast\/[^/]+\/id\d+/;
5
+ const podcastRegex = /^(?:\/[a-z]{2})?\/podcast\/(?:[^/]+\/)?id\d+/;
5
6
  const feedUrlRegex = /"feedUrl"\s*:\s*"([^"]+)"/;
6
7
  const extractFeedUrlFromContent = (content) => {
7
8
  return content.match(feedUrlRegex)?.[1];
@@ -0,0 +1,44 @@
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
3
+ import { composeHint } from "../../../common/utils.js";
4
+ //#region src/feeds/platform/handlers/arena.ts
5
+ const hosts = ["are.na", "www.are.na"];
6
+ const excludedPaths = [
7
+ "about",
8
+ "api",
9
+ "explore",
10
+ "login",
11
+ "premium",
12
+ "privacy",
13
+ "search",
14
+ "settings",
15
+ "signup",
16
+ "support",
17
+ "terms"
18
+ ];
19
+ const arenaHandler = {
20
+ match: (url) => {
21
+ return isHostOf(url, hosts);
22
+ },
23
+ resolve: (url) => {
24
+ const { pathname } = new URL(url);
25
+ const pathSegments = pathname.split("/").filter(Boolean);
26
+ if (pathSegments.length === 0) return [];
27
+ if (pathSegments[0] === "editorial") return [{
28
+ uri: "https://www.are.na/editorial/feed/rss",
29
+ hint: composeHint("arena:editorial")
30
+ }];
31
+ const username = pathSegments[0];
32
+ if (isAnyOf(username, excludedPaths)) return [];
33
+ if (pathSegments[1]) return [{
34
+ uri: `https://www.are.na/${username}/${pathSegments[1]}/feed/rss`,
35
+ hint: composeHint("arena:channel")
36
+ }];
37
+ return [{
38
+ uri: `https://www.are.na/${username}/feed/rss`,
39
+ hint: composeHint("arena:profile")
40
+ }];
41
+ }
42
+ };
43
+ //#endregion
44
+ export { arenaHandler };