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
@@ -0,0 +1,54 @@
1
+ import { isAnyOf } from "../../../../node_modules/trousse/dist/matching.js";
2
+ import { isHostOf, isSubdomainOf } from "../../../../node_modules/trousse/dist/urls.js";
3
+ import { composeHint } from "../../../common/utils.js";
4
+ //#region src/feeds/platform/handlers/artstation.ts
5
+ const hosts = ["artstation.com", "www.artstation.com"];
6
+ const domainSuffixRegex = /\.artstation\.com$/i;
7
+ const excludedPaths = [
8
+ "blogs",
9
+ "channels",
10
+ "contests",
11
+ "features",
12
+ "jobs",
13
+ "learning",
14
+ "login",
15
+ "marketplace",
16
+ "prints",
17
+ "search",
18
+ "signup",
19
+ "studios",
20
+ "terms"
21
+ ];
22
+ const artstationHandler = {
23
+ match: (url) => {
24
+ return isHostOf(url, hosts) || isSubdomainOf(url, "artstation.com");
25
+ },
26
+ resolve: (url) => {
27
+ const parsed = new URL(url);
28
+ if (!isHostOf(url, hosts) && isSubdomainOf(url, "artstation.com")) return [{
29
+ uri: `https://www.artstation.com/${parsed.hostname.replace(domainSuffixRegex, "")}.rss`,
30
+ hint: composeHint("artstation:portfolio")
31
+ }];
32
+ const pathSegments = parsed.pathname.split("/").filter(Boolean);
33
+ if (pathSegments[0] === "artwork" || pathSegments.length === 0) {
34
+ const uris = [];
35
+ uris.push({
36
+ uri: "https://www.artstation.com/artwork.rss",
37
+ hint: composeHint("artstation:artwork")
38
+ });
39
+ uris.push({
40
+ uri: "https://www.artstation.com/artwork.rss?sorting=trending",
41
+ hint: composeHint("artstation:artwork-trending")
42
+ });
43
+ return uris;
44
+ }
45
+ const username = pathSegments[0];
46
+ if (isAnyOf(username, excludedPaths)) return [];
47
+ return [{
48
+ uri: `https://www.artstation.com/${username}.rss`,
49
+ hint: composeHint("artstation:portfolio")
50
+ }];
51
+ }
52
+ };
53
+ //#endregion
54
+ export { artstationHandler };
@@ -0,0 +1,24 @@
1
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
+ import { composeHint } from "../../../common/utils.js";
3
+ //#region src/feeds/platform/handlers/audioboom.ts
4
+ const hosts = ["audioboom.com", "www.audioboom.com"];
5
+ const channelRegex = /^\/channels\/(\d+)/;
6
+ const audioboomHandler = {
7
+ match: (url) => {
8
+ return isHostOf(url, hosts);
9
+ },
10
+ resolve: (url) => {
11
+ const { pathname } = new URL(url);
12
+ const match = pathname.match(channelRegex);
13
+ if (!match?.[1]) return [];
14
+ const channelId = match[1];
15
+ const uris = [];
16
+ uris.push({
17
+ uri: `https://audioboom.com/channels/${channelId}.rss`,
18
+ hint: composeHint("audioboom:podcast")
19
+ });
20
+ return uris;
21
+ }
22
+ };
23
+ //#endregion
24
+ export { audioboomHandler };
@@ -0,0 +1,46 @@
1
+ import { isHostOf, isSubdomainOf } from "../../../../node_modules/trousse/dist/urls.js";
2
+ import { composeHint } from "../../../common/utils.js";
3
+ //#region src/feeds/platform/handlers/bearblog.ts
4
+ const apexHosts = ["bearblog.dev", "www.bearblog.dev"];
5
+ const bearblogHandler = {
6
+ match: (url) => {
7
+ return isSubdomainOf(url, "bearblog.dev") || isHostOf(url, apexHosts);
8
+ },
9
+ resolve: (url) => {
10
+ const { origin, searchParams } = new URL(url);
11
+ const uris = [];
12
+ if (isHostOf(url, apexHosts)) {
13
+ uris.push({
14
+ uri: "https://bearblog.dev/discover/feed/",
15
+ hint: composeHint("bearblog:discover-atom")
16
+ });
17
+ uris.push({
18
+ uri: "https://bearblog.dev/discover/feed/?type=rss",
19
+ hint: composeHint("bearblog:discover-rss")
20
+ });
21
+ return uris;
22
+ }
23
+ const tag = searchParams.get("q");
24
+ if (tag) {
25
+ uris.push({
26
+ uri: `${origin}/feed/?q=${encodeURIComponent(tag)}`,
27
+ hint: composeHint("bearblog:tag-atom")
28
+ });
29
+ uris.push({
30
+ uri: `${origin}/feed/?type=rss&q=${encodeURIComponent(tag)}`,
31
+ hint: composeHint("bearblog:tag-rss")
32
+ });
33
+ }
34
+ uris.push({
35
+ uri: `${origin}/feed/`,
36
+ hint: composeHint("bearblog:posts-atom")
37
+ });
38
+ uris.push({
39
+ uri: `${origin}/feed/?type=rss`,
40
+ hint: composeHint("bearblog:posts-rss")
41
+ });
42
+ return uris;
43
+ }
44
+ };
45
+ //#endregion
46
+ export { bearblogHandler };
@@ -1,4 +1,6 @@
1
- import { composeHint, 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";
3
+ import { composeHint } from "../../../common/utils.js";
2
4
  //#region src/feeds/platform/handlers/behance.ts
3
5
  const hosts = ["behance.net", "www.behance.net"];
4
6
  const userRegex = /^\/([a-zA-Z0-9_-]+)(?:\/(appreciated))?\/?$/;
@@ -27,6 +29,13 @@ const behanceHandler = {
27
29
  },
28
30
  resolve: (url) => {
29
31
  const { pathname } = new URL(url);
32
+ if (pathname === "/" || pathname === "" || pathname === "/galleries") return [{
33
+ uri: "https://www.behance.net/feeds/projects",
34
+ hint: composeHint("behance:projects")
35
+ }, {
36
+ uri: "https://feeds.feedburner.com/behance/vorr",
37
+ hint: composeHint("behance:featured")
38
+ }];
30
39
  const userMatch = pathname.match(userRegex);
31
40
  if (userMatch?.[1]) {
32
41
  const username = userMatch[1];
@@ -0,0 +1,72 @@
1
+ import { composeHint } from "../../../common/utils.js";
2
+ //#region src/feeds/platform/handlers/blogspot.ts
3
+ const blogspotDomainRegex = /^.+\.blogspot\.(?:com|co\.[a-z]{2}|com\.[a-z]{2}|[a-z]{2,3})$/;
4
+ const labelRegex = /^\/search\/label\/([^/]+)/;
5
+ const postRegex = /^\/\d{4}\/\d{2}\/[^/]+\.html$/;
6
+ const postCommentsFeedRegex = /href="[^"]*\/feeds\/(\d+)\/comments\/default/;
7
+ const blogspotHandler = {
8
+ match: (url) => {
9
+ try {
10
+ const hostname = new URL(url).hostname.toLowerCase();
11
+ return blogspotDomainRegex.test(hostname);
12
+ } catch {}
13
+ return false;
14
+ },
15
+ resolve: (url, content) => {
16
+ const { origin, pathname } = new URL(url);
17
+ const uris = [];
18
+ const labelMatch = pathname.match(labelRegex);
19
+ if (labelMatch?.[1]) {
20
+ const label = labelMatch[1];
21
+ uris.push({
22
+ uri: `${origin}/feeds/posts/default/-/${label}`,
23
+ hint: composeHint("blogspot:label-atom")
24
+ });
25
+ uris.push({
26
+ uri: `${origin}/feeds/posts/default/-/${label}?alt=rss`,
27
+ hint: composeHint("blogspot:label-rss")
28
+ });
29
+ }
30
+ if (content && postRegex.test(pathname)) {
31
+ const postIdMatch = content.match(postCommentsFeedRegex);
32
+ if (postIdMatch?.[1]) {
33
+ const postId = postIdMatch[1];
34
+ uris.push({
35
+ uri: `${origin}/feeds/${postId}/comments/default`,
36
+ hint: composeHint("blogspot:post-comments-atom")
37
+ });
38
+ uris.push({
39
+ uri: `${origin}/feeds/${postId}/comments/default?alt=rss`,
40
+ hint: composeHint("blogspot:post-comments-rss")
41
+ });
42
+ }
43
+ }
44
+ uris.push({
45
+ uri: `${origin}/feeds/posts/default`,
46
+ hint: composeHint("blogspot:posts-atom")
47
+ });
48
+ uris.push({
49
+ uri: `${origin}/feeds/posts/default?alt=rss`,
50
+ hint: composeHint("blogspot:posts-rss")
51
+ });
52
+ uris.push({
53
+ uri: `${origin}/feeds/posts/summary`,
54
+ hint: composeHint("blogspot:posts-summary-atom")
55
+ });
56
+ uris.push({
57
+ uri: `${origin}/feeds/posts/summary?alt=rss`,
58
+ hint: composeHint("blogspot:posts-summary-rss")
59
+ });
60
+ uris.push({
61
+ uri: `${origin}/feeds/comments/default`,
62
+ hint: composeHint("blogspot:comments-atom")
63
+ });
64
+ uris.push({
65
+ uri: `${origin}/feeds/comments/default?alt=rss`,
66
+ hint: composeHint("blogspot:comments-rss")
67
+ });
68
+ return uris;
69
+ }
70
+ };
71
+ //#endregion
72
+ export { blogspotHandler };
@@ -1,4 +1,5 @@
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/bluesky.ts
3
4
  const profileRegex = /^\/profile\/([^/]+)/;
4
5
  const hosts = ["bsky.app", "www.bsky.app"];
@@ -0,0 +1,48 @@
1
+ import { composeHint, hasMetaContent } from "../../../common/utils.js";
2
+ //#region src/feeds/platform/handlers/bookwyrm.ts
3
+ const profileRegex = /^\/user\/([^/]+)/;
4
+ const shelfRegex = /^\/user\/([^/]+)\/(?:shelf|books)\/([^/]+)\/?/;
5
+ const isBookwyrmHtml = (content) => {
6
+ return hasMetaContent(content, "generator", "BookWyrm");
7
+ };
8
+ const bookwyrmHandler = {
9
+ match: (url, content) => {
10
+ try {
11
+ if (!content || !isBookwyrmHtml(content)) return false;
12
+ const { pathname } = new URL(url);
13
+ return profileRegex.test(pathname);
14
+ } catch {}
15
+ return false;
16
+ },
17
+ resolve: (url) => {
18
+ try {
19
+ const { origin, pathname } = new URL(url);
20
+ const match = pathname.match(profileRegex);
21
+ if (!match?.[1]) return [];
22
+ const user = match[1];
23
+ const uris = [];
24
+ const shelfMatch = pathname.match(shelfRegex);
25
+ if (shelfMatch?.[2]) uris.push({
26
+ uri: `${origin}/user/${user}/${pathname.split("/")[3]}/${shelfMatch[2]}/rss`,
27
+ hint: composeHint("bookwyrm:shelf")
28
+ });
29
+ uris.push({
30
+ uri: `${origin}/user/${user}/rss`,
31
+ hint: composeHint("bookwyrm:activity")
32
+ }, {
33
+ uri: `${origin}/user/${user}/rss-reviews`,
34
+ hint: composeHint("bookwyrm:reviews")
35
+ }, {
36
+ uri: `${origin}/user/${user}/rss-quotes`,
37
+ hint: composeHint("bookwyrm:quotes")
38
+ }, {
39
+ uri: `${origin}/user/${user}/rss-comments`,
40
+ hint: composeHint("bookwyrm:comments")
41
+ });
42
+ return uris;
43
+ } catch {}
44
+ return [];
45
+ }
46
+ };
47
+ //#endregion
48
+ export { bookwyrmHandler };
@@ -0,0 +1,45 @@
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/buttondown.ts
5
+ const hosts = [
6
+ "buttondown.com",
7
+ "www.buttondown.com",
8
+ "buttondown.email",
9
+ "www.buttondown.email"
10
+ ];
11
+ const excludedPaths = [
12
+ "about",
13
+ "api",
14
+ "blog",
15
+ "changelog",
16
+ "docs",
17
+ "features",
18
+ "help",
19
+ "legal",
20
+ "login",
21
+ "pricing",
22
+ "privacy",
23
+ "refer",
24
+ "register",
25
+ "settings",
26
+ "terms"
27
+ ];
28
+ const buttondownHandler = {
29
+ match: (url) => {
30
+ return isHostOf(url, hosts);
31
+ },
32
+ resolve: (url) => {
33
+ const { pathname } = new URL(url);
34
+ const pathSegments = pathname.split("/").filter(Boolean);
35
+ if (pathSegments.length === 0) return [];
36
+ const username = pathSegments[0];
37
+ if (isAnyOf(username, excludedPaths)) return [];
38
+ return [{
39
+ uri: `https://buttondown.com/${username}/rss`,
40
+ hint: composeHint("buttondown:newsletter")
41
+ }];
42
+ }
43
+ };
44
+ //#endregion
45
+ export { buttondownHandler };
@@ -0,0 +1,23 @@
1
+ import { isHostOf } from "../../../../node_modules/trousse/dist/urls.js";
2
+ import { composeHint } from "../../../common/utils.js";
3
+ //#region src/feeds/platform/handlers/buzzsprout.ts
4
+ const hosts = ["buzzsprout.com", "www.buzzsprout.com"];
5
+ const numericRegex = /^\d+$/;
6
+ const buzzsproutHandler = {
7
+ match: (url) => {
8
+ return isHostOf(url, hosts);
9
+ },
10
+ resolve: (url) => {
11
+ const { pathname } = new URL(url);
12
+ const pathSegments = pathname.split("/").filter(Boolean);
13
+ if (pathSegments.length === 0) return [];
14
+ const podcastId = pathSegments[0];
15
+ if (!numericRegex.test(podcastId)) return [];
16
+ return [{
17
+ uri: `https://rss.buzzsprout.com/${podcastId}.rss`,
18
+ hint: composeHint("buzzsprout:podcast")
19
+ }];
20
+ }
21
+ };
22
+ //#endregion
23
+ export { buzzsproutHandler };
@@ -1,4 +1,6 @@
1
- import { composeHint, 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";
3
+ import { composeHint } from "../../../common/utils.js";
2
4
  //#region src/feeds/platform/handlers/codeberg.ts
3
5
  const hosts = [
4
6
  "codeberg.org",
@@ -27,7 +29,7 @@ const codebergHandler = {
27
29
  if (pathSegments.length === 1) {
28
30
  const user = pathSegments[0];
29
31
  if (!isAnyOf(user, excludedPaths)) return [{
30
- uri: `${origin}/${user}.rss`,
32
+ uri: [`${origin}/${user}.atom`, `${origin}/${user}.rss`],
31
33
  hint: composeHint("codeberg:activity")
32
34
  }];
33
35
  }
@@ -37,19 +39,19 @@ const codebergHandler = {
37
39
  if (!isAnyOf(user, excludedPaths)) {
38
40
  const feeds = [
39
41
  {
40
- uri: `${origin}/${user}/${repo}/releases.rss`,
42
+ uri: [`${origin}/${user}/${repo}/releases.atom`, `${origin}/${user}/${repo}/releases.rss`],
41
43
  hint: composeHint("codeberg:releases")
42
44
  },
43
45
  {
44
- uri: `${origin}/${user}/${repo}/tags.rss`,
46
+ uri: [`${origin}/${user}/${repo}/tags.atom`, `${origin}/${user}/${repo}/tags.rss`],
45
47
  hint: composeHint("codeberg:tags")
46
48
  },
47
49
  {
48
- uri: `${origin}/${user}/${repo}.rss`,
50
+ uri: [`${origin}/${user}/${repo}.atom`, `${origin}/${user}/${repo}.rss`],
49
51
  hint: composeHint("codeberg:activity")
50
52
  }
51
53
  ];
52
- if (pathSegments[2] === "src" && pathSegments[3] === "branch" && pathSegments[4]) {
54
+ if (isHostOf(url, ["gitea.com", "www.gitea.com"]) && pathSegments[2] === "src" && pathSegments[3] === "branch" && pathSegments[4]) {
53
55
  const branch = pathSegments[4];
54
56
  const filePath = pathSegments.slice(5).join("/");
55
57
  feeds.unshift({
@@ -1,4 +1,5 @@
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/csdn.ts
3
4
  const userRegex = /^\/([^/]+)/;
4
5
  const hosts = ["blog.csdn.net"];
@@ -1,8 +1,12 @@
1
- import { composeHint, 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";
3
+ import { composeHint } from "../../../common/utils.js";
2
4
  //#region src/feeds/platform/handlers/dailymotion.ts
3
5
  const hosts = ["dailymotion.com", "www.dailymotion.com"];
4
6
  const userRegex = /^\/([a-zA-Z0-9_-]+)$/;
5
7
  const playlistRegex = /^\/playlist\/([a-zA-Z0-9_-]+)/;
8
+ const channelRegex = /^\/channel\/([a-zA-Z0-9_-]+)/;
9
+ const searchRegex = /^\/search\/([^/]+)/;
6
10
  const excludedPaths = [
7
11
  "signin",
8
12
  "signout",
@@ -50,11 +54,25 @@ const dailymotionHandler = {
50
54
  },
51
55
  resolve: (url) => {
52
56
  const { pathname } = new URL(url);
57
+ if (pathname === "/" || pathname === "" || pathname === "/trending") return [{
58
+ uri: "https://www.dailymotion.com/rss/trending",
59
+ hint: composeHint("dailymotion:trending")
60
+ }];
53
61
  const playlistMatch = pathname.match(playlistRegex);
54
62
  if (playlistMatch?.[1]) return [{
55
63
  uri: `https://www.dailymotion.com/rss/playlist/${playlistMatch[1]}`,
56
64
  hint: composeHint("dailymotion:playlist")
57
65
  }];
66
+ const searchMatch = pathname.match(searchRegex);
67
+ if (searchMatch?.[1]) return [{
68
+ uri: `https://www.dailymotion.com/rss/search/${searchMatch[1]}`,
69
+ hint: composeHint("dailymotion:search")
70
+ }];
71
+ const channelMatch = pathname.match(channelRegex);
72
+ if (channelMatch?.[1]) return [{
73
+ uri: `https://www.dailymotion.com/rss/channel/${channelMatch[1]}`,
74
+ hint: composeHint("dailymotion:channel")
75
+ }];
58
76
  const userMatch = pathname.match(userRegex);
59
77
  if (userMatch?.[1]) {
60
78
  const username = userMatch[1];
@@ -1,24 +1,29 @@
1
- import { composeHint, 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";
3
+ import { composeHint } from "../../../common/utils.js";
2
4
  //#region src/feeds/platform/handlers/deviantart.ts
3
5
  const tagRegex = /^\/tag\/([^/]+)/;
4
6
  const favouritesRegex = /^\/([a-zA-Z0-9_-]+)\/favourites\/?$/;
5
7
  const folderRegex = /^\/([a-zA-Z0-9_-]+)\/gallery\/(\d+)(?:\/|$)/;
8
+ const journalRegex = /^\/([a-zA-Z0-9_-]+)\/journal(?:\/|$)/;
6
9
  const profileRegex = /^\/([a-zA-Z0-9_-]+)(?:\/gallery(?:\/all)?)?(?:\/|$)/;
7
10
  const hosts = ["deviantart.com", "www.deviantart.com"];
8
11
  const feedBaseUrl = "https://backend.deviantart.com/rss.xml";
9
12
  const excludedPaths = [
10
13
  "about",
14
+ "core-membership",
15
+ "daily-deviations",
16
+ "developers",
11
17
  "join",
12
- "search",
13
- "topic",
14
- "watch",
15
18
  "notifications",
19
+ "popular",
20
+ "search",
16
21
  "settings",
17
- "submit",
18
22
  "shop",
19
- "core-membership",
23
+ "submit",
20
24
  "team",
21
- "developers"
25
+ "topic",
26
+ "watch"
22
27
  ];
23
28
  const deviantartHandler = {
24
29
  match: (url) => {
@@ -26,6 +31,14 @@ const deviantartHandler = {
26
31
  },
27
32
  resolve: (url) => {
28
33
  const { pathname } = new URL(url);
34
+ if (pathname === "/daily-deviations" || pathname === "/daily-deviations/") return [{
35
+ uri: `${feedBaseUrl}?q=${encodeURIComponent("special:dd")}`,
36
+ hint: composeHint("deviantart:daily-deviations")
37
+ }];
38
+ if (pathname === "/popular" || pathname === "/popular/") return [{
39
+ uri: `${feedBaseUrl}?type=deviation&q=${encodeURIComponent("boost:popular")}`,
40
+ hint: composeHint("deviantart:popular")
41
+ }];
29
42
  const tagMatch = pathname.match(tagRegex);
30
43
  if (tagMatch?.[1]) {
31
44
  const tag = tagMatch[1];
@@ -51,6 +64,14 @@ const deviantartHandler = {
51
64
  hint: composeHint("deviantart:gallery")
52
65
  }];
53
66
  }
67
+ const journalMatch = pathname.match(journalRegex);
68
+ if (journalMatch?.[1]) {
69
+ const username = journalMatch[1];
70
+ if (!isAnyOf(username, excludedPaths)) return [{
71
+ uri: `${feedBaseUrl}?q=${encodeURIComponent(`journal:${username}`)}`,
72
+ hint: composeHint("deviantart:journal")
73
+ }];
74
+ }
54
75
  const username = pathname.match(profileRegex)?.[1];
55
76
  if (!username || isAnyOf(username, excludedPaths)) return [];
56
77
  const query = `by:${username} sort:time meta:all`;
@@ -1,4 +1,6 @@
1
- import { composeHint, 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";
3
+ import { composeHint } from "../../../common/utils.js";
2
4
  //#region src/feeds/platform/handlers/devto.ts
3
5
  const hosts = ["dev.to", "www.dev.to"];
4
6
  const userRegex = /^\/([a-zA-Z0-9_]+)\/?$/;
@@ -28,6 +30,14 @@ const devtoHandler = {
28
30
  },
29
31
  resolve: (url) => {
30
32
  const { pathname } = new URL(url);
33
+ if (pathname === "/" || pathname === "") return [{
34
+ uri: "https://dev.to/feed",
35
+ hint: composeHint("devto:community")
36
+ }];
37
+ if (pathname === "/latest" || pathname === "/latest/") return [{
38
+ uri: "https://dev.to/feed/latest",
39
+ hint: composeHint("devto:latest")
40
+ }];
31
41
  const userMatch = pathname.match(userRegex);
32
42
  if (userMatch?.[1]) {
33
43
  const username = userMatch[1];
@@ -0,0 +1,66 @@
1
+ import { composeHint, hasMetaContent } from "../../../common/utils.js";
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 = /* @__PURE__ */ 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 hasMetaContent(content, "generator", "Discourse");
22
+ };
23
+ const discourseHandler = {
24
+ match: (url, content) => {
25
+ if (!content || !isDiscourseHtml(content)) return false;
26
+ return URL.canParse(url);
27
+ },
28
+ resolve: (url) => {
29
+ try {
30
+ const { origin, pathname, searchParams } = new URL(url);
31
+ const topicMatch = pathname.match(topicRegex);
32
+ if (topicMatch?.[1] && topicMatch?.[2]) return [{
33
+ uri: `${origin}/t/${topicMatch[1]}/${topicMatch[2]}.rss`,
34
+ hint: composeHint("discourse:topic")
35
+ }];
36
+ const userMatch = pathname.match(userRegex);
37
+ if (userMatch?.[1]) return [{
38
+ uri: `${origin}/u/${userMatch[1]}/activity.rss`,
39
+ hint: composeHint("discourse:activity")
40
+ }];
41
+ const categoryMatch = pathname.match(categoryRegex);
42
+ if (categoryMatch?.[1]) return [{
43
+ uri: `${origin}/c/${categoryMatch[1]}.rss`,
44
+ hint: composeHint("discourse:category")
45
+ }];
46
+ const topMatch = pathname.match(topRegex);
47
+ if (topMatch) return [{
48
+ uri: `${origin}/top.rss${getTopPeriodSuffix(topMatch[1], searchParams)}`,
49
+ hint: composeHint("discourse:top")
50
+ }];
51
+ const uris = [];
52
+ uris.push({
53
+ uri: `${origin}/latest.rss`,
54
+ hint: composeHint("discourse:latest")
55
+ });
56
+ uris.push({
57
+ uri: `${origin}/posts.rss`,
58
+ hint: composeHint("discourse:posts")
59
+ });
60
+ return uris;
61
+ } catch {}
62
+ return [];
63
+ }
64
+ };
65
+ //#endregion
66
+ export { discourseHandler };
@@ -1,4 +1,5 @@
1
- import { composeHint, isHostOf, isSubdomainOf } from "../../../common/utils.js";
1
+ import { isHostOf, isSubdomainOf } from "../../../../node_modules/trousse/dist/urls.js";
2
+ import { composeHint } from "../../../common/utils.js";
2
3
  //#region src/feeds/platform/handlers/douban.ts
3
4
  const userRegex = /^\/people\/([^/]+)/;
4
5
  const subjectRegex = /^\/subject\/(\d+)/;
@@ -0,0 +1,49 @@
1
+ import { isHostOf, isSubdomainOf } from "../../../../node_modules/trousse/dist/urls.js";
2
+ import { composeHint } from "../../../common/utils.js";
3
+ //#region src/feeds/platform/handlers/dreamwidth.ts
4
+ const usersPathRegex = /^\/(?:users\/|~)([^/]+)/;
5
+ const tagRegex = /^\/tag\/([^/]+)/;
6
+ const dreamwidthHandler = {
7
+ match: (url) => {
8
+ if (!isSubdomainOf(url, "dreamwidth.org")) return false;
9
+ if (isHostOf(url, ["www.dreamwidth.org", "dreamwidth.org"])) return usersPathRegex.test(new URL(url).pathname);
10
+ return true;
11
+ },
12
+ resolve: (url) => {
13
+ const { origin, pathname } = new URL(url);
14
+ const uris = [];
15
+ let userOrigin = origin;
16
+ if (isHostOf(url, ["www.dreamwidth.org", "dreamwidth.org"])) {
17
+ const userMatch = pathname.match(usersPathRegex);
18
+ if (userMatch?.[1]) userOrigin = `https://${userMatch[1]}.dreamwidth.org`;
19
+ else return uris;
20
+ }
21
+ const tagMatch = pathname.match(tagRegex);
22
+ if (tagMatch?.[1]) {
23
+ const tag = encodeURIComponent(tagMatch[1]);
24
+ uris.push({
25
+ uri: `${userOrigin}/data/rss?tag=${tag}`,
26
+ hint: composeHint("dreamwidth:posts-tag-rss")
27
+ });
28
+ uris.push({
29
+ uri: `${userOrigin}/data/atom?tag=${tag}`,
30
+ hint: composeHint("dreamwidth:posts-tag-atom")
31
+ });
32
+ }
33
+ uris.push({
34
+ uri: `${userOrigin}/data/rss`,
35
+ hint: composeHint("dreamwidth:posts-rss")
36
+ });
37
+ uris.push({
38
+ uri: `${userOrigin}/data/atom`,
39
+ hint: composeHint("dreamwidth:posts-atom")
40
+ });
41
+ uris.push({
42
+ uri: `${userOrigin}/data/userpics`,
43
+ hint: composeHint("dreamwidth:userpics-atom")
44
+ });
45
+ return uris;
46
+ }
47
+ };
48
+ //#endregion
49
+ export { dreamwidthHandler };