feedkeeper 0.44.2 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-LICENSES.md +31 -0
- package/package.json +1 -1
- package/server/dist/cli.js +4 -0
- package/server/dist/doctor-cli.js +247 -0
- package/server/dist/feedkeeper.js +8 -0
- package/server/dist/feeds/content/embeds/social.js +12 -7
- package/server/dist/feeds/content/embeds/video.js +30 -24
- package/server/dist/feeds/content/patterns/oembed-providers.js +69 -0
- package/server/dist/feeds/content/patterns/providers.json +152 -0
- package/server/dist/feeds/content/patterns/social-platforms.js +35 -9
- package/server/package.json +1 -1
- package/web/dist/assets/index-BSInpowW.js +113 -0
- package/web/dist/assets/index-Cq-H4L1-.css +2 -0
- package/web/dist/index.html +2 -2
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/index-BcKdqdmb.js +0 -113
- package/web/dist/assets/index-DKnVXchH.css +0 -2
|
@@ -1,13 +1,39 @@
|
|
|
1
|
+
import { OEMBED_PROVIDER_PLATFORMS } from "./oembed-providers.js";
|
|
2
|
+
/**
|
|
3
|
+
* Platforms without suitable single-post schemes in the oEmbed provider registry.
|
|
4
|
+
* Mastodon is handled separately because every instance has its own hostname.
|
|
5
|
+
*/
|
|
6
|
+
const CUSTOM_SOCIAL_PLATFORMS = [
|
|
7
|
+
{
|
|
8
|
+
name: "Threads",
|
|
9
|
+
host: /^(?:(?:www|m|mobile)\.)?threads\.(?:net|com)$/i,
|
|
10
|
+
post: /^https?:\/\/(?:(?:www|m|mobile)\.)?threads\.(?:net|com)\/@[\w.]+\/post\/[\w-]+(?:[/?#]|$)/i,
|
|
11
|
+
kind: "social",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "Facebook",
|
|
15
|
+
host: /^(?:(?:www|m|mobile)\.)?facebook\.com$/i,
|
|
16
|
+
post: {
|
|
17
|
+
test: value => /^https?:\/\/(?:(?:www|m|mobile)\.)?facebook\.com\/(?:[^/?#]+\/)?(?:posts|activity|photos|videos|permalink|watch|reel|share)\b/i.test(value) ||
|
|
18
|
+
/^https?:\/\/(?:(?:www|m|mobile)\.)?facebook\.com\/(?:photo|permalink|story)\.php\?(?:[^#]*&)?(?:fbid|story_fbid|v)=/i.test(value) ||
|
|
19
|
+
/^https?:\/\/(?:(?:www|m|mobile)\.)?facebook\.com\/[^#]*[?&](?:story_fbid|v)=/i.test(value),
|
|
20
|
+
},
|
|
21
|
+
kind: "social",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "X",
|
|
25
|
+
host: /^(?:(?:www|m|mobile)\.)?twitter\.com$/i,
|
|
26
|
+
post: /^https?:\/\/(?:(?:www|m|mobile)\.)?twitter\.com\/(?:i\/|[\w]+\/)(?:web\/)?status\/\d+/i,
|
|
27
|
+
kind: "social",
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* The platforms whose posts become a marked link (`data-media` + `data-source`).
|
|
32
|
+
* A fixture in `test/fixtures/content/social-embeds` shows the expected result.
|
|
33
|
+
*/
|
|
1
34
|
export const SOCIAL_PLATFORMS = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
{ name: "TikTok", host: /^tiktok\.com$/, post: /\/(?:video|photo)\/\d+/, kind: "social" },
|
|
5
|
-
{ name: "Bluesky", host: /^bsky\.app$/, post: /^\/profile\/[^/]+\/post\/[\w]+/, kind: "social" },
|
|
6
|
-
{ name: "Threads", host: /^threads\.(?:net|com)$/, post: /^\/@[\w.]+\/post\/[\w-]+/, kind: "social" },
|
|
7
|
-
{ name: "Reddit", host: /^reddit\.com$/, post: /^\/r\/\w+\/comments\//, kind: "social" },
|
|
8
|
-
{ name: "Facebook", host: /^facebook\.com$/, post: /\/(?:posts|videos|photos|permalink|watch|reel|share)\b|[?&](?:story_fbid|v)=/, kind: "social" },
|
|
9
|
-
{ name: "Spotify", host: /^open\.spotify\.com$/, post: /^\/(?:track|album|playlist|episode|show|artist)\/\w+/, kind: "audio" },
|
|
10
|
-
{ name: "SoundCloud", host: /^soundcloud\.com$/, post: /^\/[^/]+\/[^/]+/, kind: "audio" },
|
|
35
|
+
...OEMBED_PROVIDER_PLATFORMS,
|
|
36
|
+
...CUSTOM_SOCIAL_PLATFORMS,
|
|
11
37
|
];
|
|
12
38
|
/** Classes of the blockquote placeholders that the platforms' scripts turn into the real post. */
|
|
13
39
|
export const SOCIAL_QUOTE = "blockquote.instagram-media, blockquote.twitter-tweet, blockquote.tiktok-embed, blockquote.bluesky-embed, " +
|