feedscout 1.4.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.
Files changed (201) hide show
  1. package/README.md +12 -17
  2. package/dist/blogrolls/defaults.cjs +1 -3
  3. package/dist/blogrolls/defaults.js +1 -2
  4. package/dist/blogrolls/extractors.cjs +6 -9
  5. package/dist/blogrolls/extractors.js +6 -9
  6. package/dist/blogrolls/index.cjs +6 -9
  7. package/dist/blogrolls/index.d.cts +1 -1
  8. package/dist/blogrolls/index.d.ts +1 -1
  9. package/dist/blogrolls/index.js +1 -4
  10. package/dist/blogrolls.cjs +4 -5
  11. package/dist/blogrolls.js +1 -2
  12. package/dist/common/discover/index.cjs +60 -21
  13. package/dist/common/discover/index.js +58 -19
  14. package/dist/common/discover/utils.cjs +30 -9
  15. package/dist/common/discover/utils.js +28 -8
  16. package/dist/common/locales.cjs +127 -8
  17. package/dist/common/locales.js +116 -2
  18. package/dist/common/types.cjs +10 -0
  19. package/dist/common/types.d.cts +23 -5
  20. package/dist/common/types.d.ts +23 -5
  21. package/dist/common/types.js +10 -0
  22. package/dist/common/uris/feed/index.cjs +12 -0
  23. package/dist/common/uris/feed/index.d.cts +6 -0
  24. package/dist/common/uris/feed/index.d.ts +6 -0
  25. package/dist/common/uris/feed/index.js +12 -0
  26. package/dist/common/uris/feed/types.d.cts +9 -0
  27. package/dist/common/uris/feed/types.d.ts +9 -0
  28. package/dist/common/uris/guess/index.cjs +2 -4
  29. package/dist/common/uris/guess/index.d.cts +2 -1
  30. package/dist/common/uris/guess/index.d.ts +2 -1
  31. package/dist/common/uris/guess/index.js +1 -3
  32. package/dist/common/uris/guess/types.d.cts +3 -1
  33. package/dist/common/uris/guess/types.d.ts +3 -1
  34. package/dist/common/uris/guess/utils.cjs +5 -4
  35. package/dist/common/uris/guess/utils.d.cts +3 -1
  36. package/dist/common/uris/guess/utils.d.ts +3 -1
  37. package/dist/common/uris/guess/utils.js +5 -3
  38. package/dist/common/uris/headers/index.cjs +2 -4
  39. package/dist/common/uris/headers/index.js +1 -3
  40. package/dist/common/uris/html/handlers.cjs +2 -4
  41. package/dist/common/uris/html/handlers.js +1 -3
  42. package/dist/common/uris/html/index.cjs +2 -4
  43. package/dist/common/uris/html/index.js +1 -3
  44. package/dist/common/uris/index.cjs +23 -17
  45. package/dist/common/uris/index.js +19 -13
  46. package/dist/common/uris/platform/index.cjs +3 -5
  47. package/dist/common/uris/platform/index.d.cts +7 -0
  48. package/dist/common/uris/platform/index.d.ts +7 -0
  49. package/dist/common/uris/platform/index.js +3 -4
  50. package/dist/common/uris/platform/types.d.cts +4 -2
  51. package/dist/common/uris/platform/types.d.ts +4 -2
  52. package/dist/common/utils.cjs +25 -8
  53. package/dist/common/utils.d.cts +2 -2
  54. package/dist/common/utils.d.ts +2 -2
  55. package/dist/common/utils.js +23 -7
  56. package/dist/favicons/defaults.cjs +60 -0
  57. package/dist/favicons/defaults.d.cts +18 -0
  58. package/dist/favicons/defaults.d.ts +18 -0
  59. package/dist/favicons/defaults.js +53 -0
  60. package/dist/favicons/extractors.cjs +13 -0
  61. package/dist/favicons/extractors.d.cts +7 -0
  62. package/dist/favicons/extractors.d.ts +7 -0
  63. package/dist/favicons/extractors.js +13 -0
  64. package/dist/favicons/index.cjs +29 -0
  65. package/dist/favicons/index.d.cts +7 -0
  66. package/dist/favicons/index.d.ts +7 -0
  67. package/dist/favicons/index.js +29 -0
  68. package/dist/favicons/platform/handlers/bluesky.cjs +27 -0
  69. package/dist/favicons/platform/handlers/bluesky.js +27 -0
  70. package/dist/favicons/platform/handlers/codeberg.cjs +18 -0
  71. package/dist/favicons/platform/handlers/codeberg.js +18 -0
  72. package/dist/favicons/platform/handlers/deviantart.cjs +29 -0
  73. package/dist/favicons/platform/handlers/deviantart.js +29 -0
  74. package/dist/favicons/platform/handlers/github.cjs +18 -0
  75. package/dist/favicons/platform/handlers/github.js +18 -0
  76. package/dist/favicons/platform/handlers/githubGist.cjs +18 -0
  77. package/dist/favicons/platform/handlers/githubGist.js +18 -0
  78. package/dist/favicons/platform/handlers/lobsters.cjs +21 -0
  79. package/dist/favicons/platform/handlers/lobsters.js +21 -0
  80. package/dist/favicons/platform/handlers/mastodon.cjs +36 -0
  81. package/dist/favicons/platform/handlers/mastodon.js +34 -0
  82. package/dist/favicons/platform/handlers/reddit.cjs +41 -0
  83. package/dist/favicons/platform/handlers/reddit.js +41 -0
  84. package/dist/favicons/platform/handlers/sourceforge.cjs +21 -0
  85. package/dist/favicons/platform/handlers/sourceforge.js +21 -0
  86. package/dist/favicons/platform/handlers/tumblr.cjs +16 -0
  87. package/dist/favicons/platform/handlers/tumblr.js +16 -0
  88. package/dist/favicons/types.d.cts +4 -0
  89. package/dist/favicons/types.d.ts +4 -0
  90. package/dist/favicons.cjs +12 -0
  91. package/dist/favicons.d.cts +4 -0
  92. package/dist/favicons.d.ts +4 -0
  93. package/dist/favicons.js +3 -0
  94. package/dist/feeds/defaults.cjs +66 -37
  95. package/dist/feeds/defaults.d.cts +2 -2
  96. package/dist/feeds/defaults.d.ts +2 -2
  97. package/dist/feeds/defaults.js +52 -23
  98. package/dist/feeds/extractors.cjs +1 -3
  99. package/dist/feeds/extractors.js +1 -3
  100. package/dist/feeds/index.cjs +6 -8
  101. package/dist/feeds/index.d.cts +1 -1
  102. package/dist/feeds/index.d.ts +1 -1
  103. package/dist/feeds/index.js +1 -3
  104. package/dist/feeds/platform/handlers/behance.cjs +10 -6
  105. package/dist/feeds/platform/handlers/behance.js +10 -6
  106. package/dist/feeds/platform/handlers/blogspot.cjs +19 -8
  107. package/dist/feeds/platform/handlers/blogspot.js +19 -7
  108. package/dist/feeds/platform/handlers/bluesky.cjs +7 -6
  109. package/dist/feeds/platform/handlers/bluesky.js +7 -6
  110. package/dist/feeds/platform/handlers/codeberg.cjs +69 -0
  111. package/dist/feeds/platform/handlers/codeberg.js +67 -0
  112. package/dist/feeds/platform/handlers/csdn.cjs +19 -0
  113. package/dist/feeds/platform/handlers/csdn.js +19 -0
  114. package/dist/feeds/platform/handlers/dailymotion.cjs +10 -6
  115. package/dist/feeds/platform/handlers/dailymotion.js +10 -6
  116. package/dist/feeds/platform/handlers/deviantart.cjs +20 -8
  117. package/dist/feeds/platform/handlers/deviantart.js +18 -8
  118. package/dist/feeds/platform/handlers/devto.cjs +10 -6
  119. package/dist/feeds/platform/handlers/devto.js +10 -6
  120. package/dist/feeds/platform/handlers/douban.cjs +54 -0
  121. package/dist/feeds/platform/handlers/douban.js +54 -0
  122. package/dist/feeds/platform/handlers/github.cjs +37 -16
  123. package/dist/feeds/platform/handlers/github.js +35 -16
  124. package/dist/feeds/platform/handlers/githubGist.cjs +17 -17
  125. package/dist/feeds/platform/handlers/githubGist.js +15 -17
  126. package/dist/feeds/platform/handlers/gitlab.cjs +18 -8
  127. package/dist/feeds/platform/handlers/gitlab.js +18 -8
  128. package/dist/feeds/platform/handlers/goodreads.cjs +39 -0
  129. package/dist/feeds/platform/handlers/goodreads.js +39 -0
  130. package/dist/feeds/platform/handlers/hashnode.cjs +16 -0
  131. package/dist/feeds/platform/handlers/hashnode.js +16 -0
  132. package/dist/feeds/platform/handlers/hatenablog.cjs +53 -0
  133. package/dist/feeds/platform/handlers/hatenablog.js +53 -0
  134. package/dist/feeds/platform/handlers/itchio.cjs +88 -0
  135. package/dist/feeds/platform/handlers/itchio.js +88 -0
  136. package/dist/feeds/platform/handlers/kickstarter.cjs +10 -6
  137. package/dist/feeds/platform/handlers/kickstarter.js +10 -6
  138. package/dist/feeds/platform/handlers/letterboxd.cjs +42 -0
  139. package/dist/feeds/platform/handlers/letterboxd.js +42 -0
  140. package/dist/feeds/platform/handlers/lobsters.cjs +35 -12
  141. package/dist/feeds/platform/handlers/lobsters.js +34 -12
  142. package/dist/feeds/platform/handlers/mastodon.cjs +40 -0
  143. package/dist/feeds/platform/handlers/mastodon.js +40 -0
  144. package/dist/feeds/platform/handlers/medium.cjs +26 -10
  145. package/dist/feeds/platform/handlers/medium.js +26 -10
  146. package/dist/feeds/platform/handlers/paragraph.cjs +21 -0
  147. package/dist/feeds/platform/handlers/paragraph.js +21 -0
  148. package/dist/feeds/platform/handlers/pinterest.cjs +6 -10
  149. package/dist/feeds/platform/handlers/pinterest.js +6 -10
  150. package/dist/feeds/platform/handlers/producthunt.cjs +14 -7
  151. package/dist/feeds/platform/handlers/producthunt.js +14 -7
  152. package/dist/feeds/platform/handlers/reddit.cjs +35 -12
  153. package/dist/feeds/platform/handlers/reddit.js +34 -12
  154. package/dist/feeds/platform/handlers/soundcloud.cjs +6 -5
  155. package/dist/feeds/platform/handlers/soundcloud.js +6 -5
  156. package/dist/feeds/platform/handlers/sourceforge.cjs +20 -0
  157. package/dist/feeds/platform/handlers/sourceforge.js +19 -0
  158. package/dist/feeds/platform/handlers/stackExchange.cjs +37 -0
  159. package/dist/feeds/platform/handlers/stackExchange.js +37 -0
  160. package/dist/feeds/platform/handlers/steam.cjs +26 -0
  161. package/dist/feeds/platform/handlers/steam.js +26 -0
  162. package/dist/feeds/platform/handlers/substack.cjs +6 -5
  163. package/dist/feeds/platform/handlers/substack.js +6 -5
  164. package/dist/feeds/platform/handlers/tumblr.cjs +13 -7
  165. package/dist/feeds/platform/handlers/tumblr.js +12 -7
  166. package/dist/feeds/platform/handlers/v2ex.cjs +33 -0
  167. package/dist/feeds/platform/handlers/v2ex.js +33 -0
  168. package/dist/feeds/platform/handlers/vimeo.cjs +68 -0
  169. package/dist/feeds/platform/handlers/vimeo.js +68 -0
  170. package/dist/feeds/platform/handlers/wordpress.cjs +46 -12
  171. package/dist/feeds/platform/handlers/wordpress.js +46 -12
  172. package/dist/feeds/platform/handlers/wpengine.cjs +10 -0
  173. package/dist/feeds/platform/handlers/wpengine.js +11 -0
  174. package/dist/feeds/platform/handlers/ximalaya.cjs +19 -0
  175. package/dist/feeds/platform/handlers/ximalaya.js +19 -0
  176. package/dist/feeds/platform/handlers/youtube.cjs +35 -13
  177. package/dist/feeds/platform/handlers/youtube.js +35 -13
  178. package/dist/feeds.cjs +4 -5
  179. package/dist/feeds.js +1 -2
  180. package/dist/hubs/discover/index.cjs +7 -9
  181. package/dist/hubs/discover/index.js +1 -3
  182. package/dist/hubs/discover/utils.cjs +1 -3
  183. package/dist/hubs/discover/utils.js +1 -2
  184. package/dist/hubs/feed/index.cjs +1 -3
  185. package/dist/hubs/feed/index.js +1 -3
  186. package/dist/hubs/headers/index.cjs +3 -5
  187. package/dist/hubs/headers/index.js +1 -3
  188. package/dist/hubs/html/index.cjs +3 -5
  189. package/dist/hubs/html/index.js +1 -3
  190. package/dist/hubs.js +1 -1
  191. package/dist/index.cjs +8 -7
  192. package/dist/index.d.cts +3 -2
  193. package/dist/index.d.ts +3 -2
  194. package/dist/index.js +2 -2
  195. package/dist/methods.cjs +13 -10
  196. package/dist/methods.d.cts +3 -1
  197. package/dist/methods.d.ts +3 -1
  198. package/dist/methods.js +3 -2
  199. package/dist/utils.cjs +3 -4
  200. package/dist/utils.js +1 -2
  201. package/package.json +15 -5
@@ -1,5 +1,4 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
2
-
1
+ import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
3
2
  //#region src/feeds/platform/handlers/github.ts
4
3
  const hosts = ["github.com", "www.github.com"];
5
4
  const excludedPaths = [
@@ -40,6 +39,7 @@ const excludedPaths = [
40
39
  "security",
41
40
  "sessions",
42
41
  "settings",
42
+ "signup",
43
43
  "site",
44
44
  "sponsors",
45
45
  "stars",
@@ -56,34 +56,53 @@ const githubHandler = {
56
56
  const { pathname } = new URL(url);
57
57
  const uris = [];
58
58
  const userMatch = pathname.match(/^\/([^/]+)\/?$/);
59
- if (userMatch?.[1] && !isAnyOf(userMatch[1], excludedPaths)) {
60
- const user = userMatch[1];
61
- uris.push(`https://github.com/${user}.atom`);
62
- return uris;
63
- }
59
+ if (userMatch?.[1] && !isAnyOf(userMatch[1], excludedPaths)) return [{
60
+ uri: `https://github.com/${userMatch[1]}.atom`,
61
+ hint: composeHint("github:activity")
62
+ }];
64
63
  const repoMatch = pathname.match(/^\/([^/]+)\/([^/]+)/);
65
64
  const owner = repoMatch?.[1];
66
65
  const repo = repoMatch?.[2];
67
66
  if (!owner || !repo || isAnyOf(owner, excludedPaths)) return [];
68
- uris.push(`https://github.com/${owner}/${repo}/releases.atom`);
69
- uris.push(`https://github.com/${owner}/${repo}/commits.atom`);
70
- uris.push(`https://github.com/${owner}/${repo}/tags.atom`);
71
- if (/\/wiki(\/|$)/.test(pathname)) uris.push(`https://github.com/${owner}/${repo}/wiki.atom`);
72
- if (/\/discussions(\/|$)/.test(pathname)) uris.push(`https://github.com/${owner}/${repo}/discussions.atom`);
67
+ uris.push({
68
+ uri: `https://github.com/${owner}/${repo}/releases.atom`,
69
+ hint: composeHint("github:releases")
70
+ });
71
+ uris.push({
72
+ uri: `https://github.com/${owner}/${repo}/commits.atom`,
73
+ hint: composeHint("github:commits")
74
+ });
75
+ uris.push({
76
+ uri: `https://github.com/${owner}/${repo}/tags.atom`,
77
+ hint: composeHint("github:tags")
78
+ });
79
+ if (/\/wiki(\/|$)/.test(pathname)) uris.push({
80
+ uri: `https://github.com/${owner}/${repo}/wiki.atom`,
81
+ hint: composeHint("github:wiki")
82
+ });
83
+ if (/\/discussions(\/|$)/.test(pathname)) uris.push({
84
+ uri: `https://github.com/${owner}/${repo}/discussions.atom`,
85
+ hint: composeHint("github:discussions")
86
+ });
73
87
  const branchMatch = pathname.match(/^\/[^/]+\/[^/]+\/tree\/([^/]+)\/?$/);
74
88
  if (branchMatch?.[1]) {
75
89
  const branch = branchMatch[1];
76
- uris.push(`https://github.com/${owner}/${repo}/commits/${branch}.atom`);
90
+ uris.push({
91
+ uri: `https://github.com/${owner}/${repo}/commits/${branch}.atom`,
92
+ hint: composeHint("github:branch-commits")
93
+ });
77
94
  }
78
95
  const fileMatch = pathname.match(/^\/[^/]+\/[^/]+\/(?:blob|commits)\/([^/]+)\/(.+)/);
79
96
  if (fileMatch?.[1] && fileMatch?.[2]) {
80
97
  const branch = fileMatch[1];
81
98
  const filePath = fileMatch[2];
82
- uris.push(`https://github.com/${owner}/${repo}/commits/${branch}/${filePath}.atom`);
99
+ uris.push({
100
+ uri: `https://github.com/${owner}/${repo}/commits/${branch}/${filePath}.atom`,
101
+ hint: composeHint("github:file-history")
102
+ });
83
103
  }
84
104
  return uris;
85
105
  }
86
106
  };
87
-
88
107
  //#endregion
89
- export { githubHandler };
108
+ export { excludedPaths, githubHandler, hosts };
@@ -1,5 +1,4 @@
1
- const require_utils = require('../../../common/utils.cjs');
2
-
1
+ const require_utils = require("../../../common/utils.cjs");
3
2
  //#region src/feeds/platform/handlers/githubGist.ts
4
3
  const hosts = ["gist.github.com"];
5
4
  const excludedPaths = [
@@ -15,28 +14,29 @@ const githubGistHandler = {
15
14
  },
16
15
  resolve: (url) => {
17
16
  const { pathname } = new URL(url);
18
- const uris = [];
19
17
  const gistMatch = pathname.match(/^\/([^/]+)\/([a-f0-9]+)/);
20
18
  if (gistMatch?.[1] && gistMatch?.[2]) {
21
19
  const username = gistMatch[1];
22
- if (!require_utils.isAnyOf(username, excludedPaths)) uris.push(`https://gist.github.com/${username}.atom`);
23
- return uris;
20
+ if (!require_utils.isAnyOf(username, excludedPaths)) return [{
21
+ uri: `https://gist.github.com/${username}.atom`,
22
+ hint: require_utils.composeHint("github-gist:gists")
23
+ }];
24
+ return [];
24
25
  }
25
26
  const starredMatch = pathname.match(/^\/([^/]+)\/starred\/?$/);
26
- if (starredMatch?.[1] && !require_utils.isAnyOf(starredMatch[1], excludedPaths)) {
27
- const username = starredMatch[1];
28
- uris.push(`https://gist.github.com/${username}/starred.atom`);
29
- return uris;
30
- }
27
+ if (starredMatch?.[1] && !require_utils.isAnyOf(starredMatch[1], excludedPaths)) return [{
28
+ uri: `https://gist.github.com/${starredMatch[1]}/starred.atom`,
29
+ hint: require_utils.composeHint("github-gist:starred")
30
+ }];
31
31
  const userMatch = pathname.match(/^\/([^/]+)\/?$/);
32
- if (userMatch?.[1] && !require_utils.isAnyOf(userMatch[1], excludedPaths)) {
33
- const username = userMatch[1];
34
- uris.push(`https://gist.github.com/${username}.atom`);
35
- return uris;
36
- }
32
+ if (userMatch?.[1] && !require_utils.isAnyOf(userMatch[1], excludedPaths)) return [{
33
+ uri: `https://gist.github.com/${userMatch[1]}.atom`,
34
+ hint: require_utils.composeHint("github-gist:gists")
35
+ }];
37
36
  return [];
38
37
  }
39
38
  };
40
-
41
39
  //#endregion
42
- exports.githubGistHandler = githubGistHandler;
40
+ exports.excludedPaths = excludedPaths;
41
+ exports.githubGistHandler = githubGistHandler;
42
+ exports.hosts = hosts;
@@ -1,5 +1,4 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
2
-
1
+ import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
3
2
  //#region src/feeds/platform/handlers/githubGist.ts
4
3
  const hosts = ["gist.github.com"];
5
4
  const excludedPaths = [
@@ -15,28 +14,27 @@ const githubGistHandler = {
15
14
  },
16
15
  resolve: (url) => {
17
16
  const { pathname } = new URL(url);
18
- const uris = [];
19
17
  const gistMatch = pathname.match(/^\/([^/]+)\/([a-f0-9]+)/);
20
18
  if (gistMatch?.[1] && gistMatch?.[2]) {
21
19
  const username = gistMatch[1];
22
- if (!isAnyOf(username, excludedPaths)) uris.push(`https://gist.github.com/${username}.atom`);
23
- return uris;
20
+ if (!isAnyOf(username, excludedPaths)) return [{
21
+ uri: `https://gist.github.com/${username}.atom`,
22
+ hint: composeHint("github-gist:gists")
23
+ }];
24
+ return [];
24
25
  }
25
26
  const starredMatch = pathname.match(/^\/([^/]+)\/starred\/?$/);
26
- if (starredMatch?.[1] && !isAnyOf(starredMatch[1], excludedPaths)) {
27
- const username = starredMatch[1];
28
- uris.push(`https://gist.github.com/${username}/starred.atom`);
29
- return uris;
30
- }
27
+ if (starredMatch?.[1] && !isAnyOf(starredMatch[1], excludedPaths)) return [{
28
+ uri: `https://gist.github.com/${starredMatch[1]}/starred.atom`,
29
+ hint: composeHint("github-gist:starred")
30
+ }];
31
31
  const userMatch = pathname.match(/^\/([^/]+)\/?$/);
32
- if (userMatch?.[1] && !isAnyOf(userMatch[1], excludedPaths)) {
33
- const username = userMatch[1];
34
- uris.push(`https://gist.github.com/${username}.atom`);
35
- return uris;
36
- }
32
+ if (userMatch?.[1] && !isAnyOf(userMatch[1], excludedPaths)) return [{
33
+ uri: `https://gist.github.com/${userMatch[1]}.atom`,
34
+ hint: composeHint("github-gist:gists")
35
+ }];
37
36
  return [];
38
37
  }
39
38
  };
40
-
41
39
  //#endregion
42
- export { githubGistHandler };
40
+ export { excludedPaths, githubGistHandler, hosts };
@@ -1,5 +1,4 @@
1
- const require_utils = require('../../../common/utils.cjs');
2
-
1
+ const require_utils = require("../../../common/utils.cjs");
3
2
  //#region src/feeds/platform/handlers/gitlab.ts
4
3
  const hosts = ["gitlab.com", "www.gitlab.com"];
5
4
  const excludedPaths = [
@@ -34,20 +33,31 @@ const gitlabHandler = {
34
33
  const pathSegments = pathname.split("/").filter(Boolean);
35
34
  if (pathSegments.length === 1) {
36
35
  const user = pathSegments[0];
37
- if (!require_utils.isAnyOf(user, excludedPaths)) return [`${origin}/${user}.atom`];
36
+ if (!require_utils.isAnyOf(user, excludedPaths)) return [{
37
+ uri: `${origin}/${user}.atom`,
38
+ hint: require_utils.composeHint("gitlab:activity")
39
+ }];
38
40
  }
39
41
  if (pathSegments.length >= 2) {
40
42
  const user = pathSegments[0];
41
43
  const repo = pathSegments[1];
42
44
  if (!require_utils.isAnyOf(user, excludedPaths)) return [
43
- `${origin}/${user}/${repo}/-/releases.atom`,
44
- `${origin}/${user}/${repo}/-/tags?format=atom`,
45
- `${origin}/${user}/${repo}.atom`
45
+ {
46
+ uri: `${origin}/${user}/${repo}/-/releases.atom`,
47
+ hint: require_utils.composeHint("gitlab:releases")
48
+ },
49
+ {
50
+ uri: `${origin}/${user}/${repo}/-/tags?format=atom`,
51
+ hint: require_utils.composeHint("gitlab:tags")
52
+ },
53
+ {
54
+ uri: `${origin}/${user}/${repo}.atom`,
55
+ hint: require_utils.composeHint("gitlab:activity")
56
+ }
46
57
  ];
47
58
  }
48
59
  return [];
49
60
  }
50
61
  };
51
-
52
62
  //#endregion
53
- exports.gitlabHandler = gitlabHandler;
63
+ exports.gitlabHandler = gitlabHandler;
@@ -1,5 +1,4 @@
1
- import { isAnyOf, isHostOf } from "../../../common/utils.js";
2
-
1
+ import { composeHint, isAnyOf, isHostOf } from "../../../common/utils.js";
3
2
  //#region src/feeds/platform/handlers/gitlab.ts
4
3
  const hosts = ["gitlab.com", "www.gitlab.com"];
5
4
  const excludedPaths = [
@@ -34,20 +33,31 @@ const gitlabHandler = {
34
33
  const pathSegments = pathname.split("/").filter(Boolean);
35
34
  if (pathSegments.length === 1) {
36
35
  const user = pathSegments[0];
37
- if (!isAnyOf(user, excludedPaths)) return [`${origin}/${user}.atom`];
36
+ if (!isAnyOf(user, excludedPaths)) return [{
37
+ uri: `${origin}/${user}.atom`,
38
+ hint: composeHint("gitlab:activity")
39
+ }];
38
40
  }
39
41
  if (pathSegments.length >= 2) {
40
42
  const user = pathSegments[0];
41
43
  const repo = pathSegments[1];
42
44
  if (!isAnyOf(user, excludedPaths)) return [
43
- `${origin}/${user}/${repo}/-/releases.atom`,
44
- `${origin}/${user}/${repo}/-/tags?format=atom`,
45
- `${origin}/${user}/${repo}.atom`
45
+ {
46
+ uri: `${origin}/${user}/${repo}/-/releases.atom`,
47
+ hint: composeHint("gitlab:releases")
48
+ },
49
+ {
50
+ uri: `${origin}/${user}/${repo}/-/tags?format=atom`,
51
+ hint: composeHint("gitlab:tags")
52
+ },
53
+ {
54
+ uri: `${origin}/${user}/${repo}.atom`,
55
+ hint: composeHint("gitlab:activity")
56
+ }
46
57
  ];
47
58
  }
48
59
  return [];
49
60
  }
50
61
  };
51
-
52
62
  //#endregion
53
- export { gitlabHandler };
63
+ export { gitlabHandler };
@@ -0,0 +1,39 @@
1
+ const require_utils = require("../../../common/utils.cjs");
2
+ //#region src/feeds/platform/handlers/goodreads.ts
3
+ const hosts = ["goodreads.com", "www.goodreads.com"];
4
+ const parseUserId = (segment) => {
5
+ const id = Number.parseInt(segment, 10);
6
+ return Number.isNaN(id) ? void 0 : id;
7
+ };
8
+ const goodreadsHandler = {
9
+ match: (url) => {
10
+ return require_utils.isHostOf(url, hosts);
11
+ },
12
+ resolve: (url) => {
13
+ const { origin, pathname } = new URL(url);
14
+ const pathSegments = pathname.split("/").filter(Boolean);
15
+ if (pathSegments[0] === "user" && pathSegments[1] === "show" && pathSegments[2]) {
16
+ const userId = parseUserId(pathSegments[2]);
17
+ if (userId) return [{
18
+ uri: `${origin}/user/updates_rss/${userId}`,
19
+ hint: require_utils.composeHint("goodreads:updates")
20
+ }, {
21
+ uri: `${origin}/review/list_rss/${userId}`,
22
+ hint: require_utils.composeHint("goodreads:reviews")
23
+ }];
24
+ }
25
+ if (pathSegments[0] === "review" && pathSegments[1] === "list" && pathSegments[2]) {
26
+ const userId = parseUserId(pathSegments[2]);
27
+ if (userId) return [{
28
+ uri: `${origin}/review/list_rss/${userId}`,
29
+ hint: require_utils.composeHint("goodreads:reviews")
30
+ }, {
31
+ uri: `${origin}/user/updates_rss/${userId}`,
32
+ hint: require_utils.composeHint("goodreads:updates")
33
+ }];
34
+ }
35
+ return [];
36
+ }
37
+ };
38
+ //#endregion
39
+ exports.goodreadsHandler = goodreadsHandler;
@@ -0,0 +1,39 @@
1
+ import { composeHint, isHostOf } from "../../../common/utils.js";
2
+ //#region src/feeds/platform/handlers/goodreads.ts
3
+ const hosts = ["goodreads.com", "www.goodreads.com"];
4
+ const parseUserId = (segment) => {
5
+ const id = Number.parseInt(segment, 10);
6
+ return Number.isNaN(id) ? void 0 : id;
7
+ };
8
+ const goodreadsHandler = {
9
+ match: (url) => {
10
+ return isHostOf(url, hosts);
11
+ },
12
+ resolve: (url) => {
13
+ const { origin, pathname } = new URL(url);
14
+ const pathSegments = pathname.split("/").filter(Boolean);
15
+ if (pathSegments[0] === "user" && pathSegments[1] === "show" && pathSegments[2]) {
16
+ const userId = parseUserId(pathSegments[2]);
17
+ if (userId) return [{
18
+ uri: `${origin}/user/updates_rss/${userId}`,
19
+ hint: composeHint("goodreads:updates")
20
+ }, {
21
+ uri: `${origin}/review/list_rss/${userId}`,
22
+ hint: composeHint("goodreads:reviews")
23
+ }];
24
+ }
25
+ if (pathSegments[0] === "review" && pathSegments[1] === "list" && pathSegments[2]) {
26
+ const userId = parseUserId(pathSegments[2]);
27
+ if (userId) return [{
28
+ uri: `${origin}/review/list_rss/${userId}`,
29
+ hint: composeHint("goodreads:reviews")
30
+ }, {
31
+ uri: `${origin}/user/updates_rss/${userId}`,
32
+ hint: composeHint("goodreads:updates")
33
+ }];
34
+ }
35
+ return [];
36
+ }
37
+ };
38
+ //#endregion
39
+ export { goodreadsHandler };
@@ -0,0 +1,16 @@
1
+ const require_utils = require("../../../common/utils.cjs");
2
+ //#region src/feeds/platform/handlers/hashnode.ts
3
+ const hashnodeHandler = {
4
+ match: (url) => {
5
+ return require_utils.isSubdomainOf(url, "hashnode.dev");
6
+ },
7
+ resolve: (url) => {
8
+ const { origin } = new URL(url);
9
+ return [{
10
+ uri: `${origin}/rss.xml`,
11
+ hint: require_utils.composeHint("hashnode:blog")
12
+ }];
13
+ }
14
+ };
15
+ //#endregion
16
+ exports.hashnodeHandler = hashnodeHandler;
@@ -0,0 +1,16 @@
1
+ import { composeHint, isSubdomainOf } from "../../../common/utils.js";
2
+ //#region src/feeds/platform/handlers/hashnode.ts
3
+ const hashnodeHandler = {
4
+ match: (url) => {
5
+ return isSubdomainOf(url, "hashnode.dev");
6
+ },
7
+ resolve: (url) => {
8
+ const { origin } = new URL(url);
9
+ return [{
10
+ uri: `${origin}/rss.xml`,
11
+ hint: composeHint("hashnode:blog")
12
+ }];
13
+ }
14
+ };
15
+ //#endregion
16
+ export { hashnodeHandler };
@@ -0,0 +1,53 @@
1
+ const require_utils = require("../../../common/utils.cjs");
2
+ //#region src/feeds/platform/handlers/hatenablog.ts
3
+ const domains = [
4
+ "hatenablog.com",
5
+ "hatenablog.jp",
6
+ "hateblo.jp"
7
+ ];
8
+ const categoryPathRegex = /^\/archive\/category\/([^/]+)/;
9
+ const authorPathRegex = /^\/archive\/author\/([^/]+)/;
10
+ const hatenablogHandler = {
11
+ match: (url) => {
12
+ return require_utils.isSubdomainOf(url, domains);
13
+ },
14
+ resolve: (url) => {
15
+ const { origin, pathname } = new URL(url);
16
+ const uris = [];
17
+ const categoryMatch = pathname.match(categoryPathRegex);
18
+ if (categoryMatch?.[1]) {
19
+ const category = categoryMatch[1];
20
+ uris.push({
21
+ uri: `${origin}/rss/category/${category}`,
22
+ hint: require_utils.composeHint("hatenablog:category-rss")
23
+ });
24
+ uris.push({
25
+ uri: `${origin}/feed/category/${category}`,
26
+ hint: require_utils.composeHint("hatenablog:category-atom")
27
+ });
28
+ }
29
+ const authorMatch = pathname.match(authorPathRegex);
30
+ if (authorMatch?.[1]) {
31
+ const author = authorMatch[1];
32
+ uris.push({
33
+ uri: `${origin}/rss/author/${author}`,
34
+ hint: require_utils.composeHint("hatenablog:author-rss")
35
+ });
36
+ uris.push({
37
+ uri: `${origin}/feed/author/${author}`,
38
+ hint: require_utils.composeHint("hatenablog:author-atom")
39
+ });
40
+ }
41
+ uris.push({
42
+ uri: `${origin}/rss`,
43
+ hint: require_utils.composeHint("hatenablog:posts-rss")
44
+ });
45
+ uris.push({
46
+ uri: `${origin}/feed`,
47
+ hint: require_utils.composeHint("hatenablog:posts-atom")
48
+ });
49
+ return uris;
50
+ }
51
+ };
52
+ //#endregion
53
+ exports.hatenablogHandler = hatenablogHandler;
@@ -0,0 +1,53 @@
1
+ import { composeHint, isSubdomainOf } from "../../../common/utils.js";
2
+ //#region src/feeds/platform/handlers/hatenablog.ts
3
+ const domains = [
4
+ "hatenablog.com",
5
+ "hatenablog.jp",
6
+ "hateblo.jp"
7
+ ];
8
+ const categoryPathRegex = /^\/archive\/category\/([^/]+)/;
9
+ const authorPathRegex = /^\/archive\/author\/([^/]+)/;
10
+ const hatenablogHandler = {
11
+ match: (url) => {
12
+ return isSubdomainOf(url, domains);
13
+ },
14
+ resolve: (url) => {
15
+ const { origin, pathname } = new URL(url);
16
+ const uris = [];
17
+ const categoryMatch = pathname.match(categoryPathRegex);
18
+ if (categoryMatch?.[1]) {
19
+ const category = categoryMatch[1];
20
+ uris.push({
21
+ uri: `${origin}/rss/category/${category}`,
22
+ hint: composeHint("hatenablog:category-rss")
23
+ });
24
+ uris.push({
25
+ uri: `${origin}/feed/category/${category}`,
26
+ hint: composeHint("hatenablog:category-atom")
27
+ });
28
+ }
29
+ const authorMatch = pathname.match(authorPathRegex);
30
+ if (authorMatch?.[1]) {
31
+ const author = authorMatch[1];
32
+ uris.push({
33
+ uri: `${origin}/rss/author/${author}`,
34
+ hint: composeHint("hatenablog:author-rss")
35
+ });
36
+ uris.push({
37
+ uri: `${origin}/feed/author/${author}`,
38
+ hint: composeHint("hatenablog:author-atom")
39
+ });
40
+ }
41
+ uris.push({
42
+ uri: `${origin}/rss`,
43
+ hint: composeHint("hatenablog:posts-rss")
44
+ });
45
+ uris.push({
46
+ uri: `${origin}/feed`,
47
+ hint: composeHint("hatenablog:posts-atom")
48
+ });
49
+ return uris;
50
+ }
51
+ };
52
+ //#endregion
53
+ export { hatenablogHandler };
@@ -0,0 +1,88 @@
1
+ const require_utils = require("../../../common/utils.cjs");
2
+ //#region src/feeds/platform/handlers/itchio.ts
3
+ const mainHosts = ["itch.io", "www.itch.io"];
4
+ const sections = [
5
+ "tools",
6
+ "game-assets",
7
+ "soundtracks",
8
+ "physical-games",
9
+ "books",
10
+ "comics",
11
+ "misc"
12
+ ];
13
+ const sorts = [
14
+ "newest",
15
+ "top-rated",
16
+ "top-sellers",
17
+ "on-sale"
18
+ ];
19
+ const byUserPathRegex = /^\/games\/by-([^/]+)/;
20
+ const tagPathRegex = /^\/games\/tag-([^/]+)/;
21
+ const sortPathRegex = /^\/games\/([^/.]+)/;
22
+ const sectionPathRegex = /^\/([^/.]+)/;
23
+ const gamePathRegex = /^\/([^/]+)/;
24
+ const itchioHandler = {
25
+ match: (url) => {
26
+ return require_utils.isHostOf(url, mainHosts) || require_utils.isSubdomainOf(url, "itch.io");
27
+ },
28
+ resolve: (url) => {
29
+ const { hostname, pathname } = new URL(url);
30
+ const lowerHostname = hostname.toLowerCase();
31
+ if (!mainHosts.includes(lowerHostname) && lowerHostname.endsWith(".itch.io")) {
32
+ const creator = lowerHostname.replace(".itch.io", "");
33
+ const gameMatch = pathname.match(gamePathRegex);
34
+ if (gameMatch?.[1]) return [{
35
+ uri: `https://${creator}.itch.io/${gameMatch[1]}/devlog.rss`,
36
+ hint: require_utils.composeHint("itchio:devlog")
37
+ }];
38
+ return [{
39
+ uri: `https://itch.io/games/by-${creator}.xml`,
40
+ hint: require_utils.composeHint("itchio:games")
41
+ }];
42
+ }
43
+ const byUserMatch = pathname.match(byUserPathRegex);
44
+ if (byUserMatch?.[1]) return [{
45
+ uri: `https://itch.io/games/by-${byUserMatch[1]}.xml`,
46
+ hint: require_utils.composeHint("itchio:games")
47
+ }];
48
+ const tagMatch = pathname.match(tagPathRegex);
49
+ if (tagMatch?.[1]) return [{
50
+ uri: `https://itch.io/games/tag-${tagMatch[1]}.xml`,
51
+ hint: require_utils.composeHint("itchio:tag")
52
+ }];
53
+ const sortMatch = pathname.match(sortPathRegex);
54
+ if (sortMatch?.[1] && require_utils.isAnyOf(sortMatch[1], sorts)) return [{
55
+ uri: `https://itch.io/games/${sortMatch[1]}.xml`,
56
+ hint: require_utils.composeHint("itchio:games")
57
+ }];
58
+ if (pathname === "/games" || pathname === "/games/") return [{
59
+ uri: "https://itch.io/games.xml",
60
+ hint: require_utils.composeHint("itchio:games")
61
+ }];
62
+ if (pathname === "/devlogs" || pathname === "/devlogs/") return [{
63
+ uri: "https://itch.io/devlogs.xml",
64
+ hint: require_utils.composeHint("itchio:devlog")
65
+ }];
66
+ const sectionMatch = pathname.match(sectionPathRegex);
67
+ if (sectionMatch?.[1] && require_utils.isAnyOf(sectionMatch[1], sections)) return [{
68
+ uri: `https://itch.io/${sectionMatch[1]}.xml`,
69
+ hint: require_utils.composeHint("itchio:section")
70
+ }];
71
+ const uris = [];
72
+ uris.push({
73
+ uri: "https://itch.io/feed/featured.xml",
74
+ hint: require_utils.composeHint("itchio:featured")
75
+ });
76
+ uris.push({
77
+ uri: "https://itch.io/feed/new.xml",
78
+ hint: require_utils.composeHint("itchio:new")
79
+ });
80
+ uris.push({
81
+ uri: "https://itch.io/feed/sales.xml",
82
+ hint: require_utils.composeHint("itchio:sales")
83
+ });
84
+ return uris;
85
+ }
86
+ };
87
+ //#endregion
88
+ exports.itchioHandler = itchioHandler;
@@ -0,0 +1,88 @@
1
+ import { composeHint, isAnyOf, isHostOf, isSubdomainOf } from "../../../common/utils.js";
2
+ //#region src/feeds/platform/handlers/itchio.ts
3
+ const mainHosts = ["itch.io", "www.itch.io"];
4
+ const sections = [
5
+ "tools",
6
+ "game-assets",
7
+ "soundtracks",
8
+ "physical-games",
9
+ "books",
10
+ "comics",
11
+ "misc"
12
+ ];
13
+ const sorts = [
14
+ "newest",
15
+ "top-rated",
16
+ "top-sellers",
17
+ "on-sale"
18
+ ];
19
+ const byUserPathRegex = /^\/games\/by-([^/]+)/;
20
+ const tagPathRegex = /^\/games\/tag-([^/]+)/;
21
+ const sortPathRegex = /^\/games\/([^/.]+)/;
22
+ const sectionPathRegex = /^\/([^/.]+)/;
23
+ const gamePathRegex = /^\/([^/]+)/;
24
+ const itchioHandler = {
25
+ match: (url) => {
26
+ return isHostOf(url, mainHosts) || isSubdomainOf(url, "itch.io");
27
+ },
28
+ resolve: (url) => {
29
+ const { hostname, pathname } = new URL(url);
30
+ const lowerHostname = hostname.toLowerCase();
31
+ if (!mainHosts.includes(lowerHostname) && lowerHostname.endsWith(".itch.io")) {
32
+ const creator = lowerHostname.replace(".itch.io", "");
33
+ const gameMatch = pathname.match(gamePathRegex);
34
+ if (gameMatch?.[1]) return [{
35
+ uri: `https://${creator}.itch.io/${gameMatch[1]}/devlog.rss`,
36
+ hint: composeHint("itchio:devlog")
37
+ }];
38
+ return [{
39
+ uri: `https://itch.io/games/by-${creator}.xml`,
40
+ hint: composeHint("itchio:games")
41
+ }];
42
+ }
43
+ const byUserMatch = pathname.match(byUserPathRegex);
44
+ if (byUserMatch?.[1]) return [{
45
+ uri: `https://itch.io/games/by-${byUserMatch[1]}.xml`,
46
+ hint: composeHint("itchio:games")
47
+ }];
48
+ const tagMatch = pathname.match(tagPathRegex);
49
+ if (tagMatch?.[1]) return [{
50
+ uri: `https://itch.io/games/tag-${tagMatch[1]}.xml`,
51
+ hint: composeHint("itchio:tag")
52
+ }];
53
+ const sortMatch = pathname.match(sortPathRegex);
54
+ if (sortMatch?.[1] && isAnyOf(sortMatch[1], sorts)) return [{
55
+ uri: `https://itch.io/games/${sortMatch[1]}.xml`,
56
+ hint: composeHint("itchio:games")
57
+ }];
58
+ if (pathname === "/games" || pathname === "/games/") return [{
59
+ uri: "https://itch.io/games.xml",
60
+ hint: composeHint("itchio:games")
61
+ }];
62
+ if (pathname === "/devlogs" || pathname === "/devlogs/") return [{
63
+ uri: "https://itch.io/devlogs.xml",
64
+ hint: composeHint("itchio:devlog")
65
+ }];
66
+ const sectionMatch = pathname.match(sectionPathRegex);
67
+ if (sectionMatch?.[1] && isAnyOf(sectionMatch[1], sections)) return [{
68
+ uri: `https://itch.io/${sectionMatch[1]}.xml`,
69
+ hint: composeHint("itchio:section")
70
+ }];
71
+ const uris = [];
72
+ uris.push({
73
+ uri: "https://itch.io/feed/featured.xml",
74
+ hint: composeHint("itchio:featured")
75
+ });
76
+ uris.push({
77
+ uri: "https://itch.io/feed/new.xml",
78
+ hint: composeHint("itchio:new")
79
+ });
80
+ uris.push({
81
+ uri: "https://itch.io/feed/sales.xml",
82
+ hint: composeHint("itchio:sales")
83
+ });
84
+ return uris;
85
+ }
86
+ };
87
+ //#endregion
88
+ export { itchioHandler };