@sockethub/platform-metadata 1.0.1-beta.0 → 1.0.1-beta.1

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.
@@ -56,10 +56,32 @@ export declare function isFacebookUrl(url: string): boolean;
56
56
  * Remove the engagement-stats segment Facebook prepends to video titles:
57
57
  * "2.2M views · 21K reactions | <video title> | <author>". The stats are
58
58
  * localized to the *scraping server's* geo-IP language, so match their
59
- * shape — a leading pipe-delimited segment containing a digit and the "·"
60
- * separator — rather than any particular wording.
59
+ * shape rather than any particular wording: a leading pipe-delimited
60
+ * segment that either contains a digit and the "·" separator, or — when
61
+ * Facebook reports a single count, e.g. "330.213 Aufrufe | Reel by X",
62
+ * "347K views | …" or "2,2 mil. zhlédnutí | …" — is a count-shaped number
63
+ * (grouping or decimal separator, magnitude suffix, or at least four
64
+ * digits), an optional abbreviation, and one word. The view label itself
65
+ * cannot be matched: it is whatever Facebook's geo-IP locale produces. The
66
+ * count shape keeps a caption that merely starts with a small number
67
+ * ("10 Goals | Author") intact; only counts below 1,000 with no suffix
68
+ * would leak into the title.
61
69
  */
62
70
  export declare function stripFacebookEngagement(title: string | undefined): string | undefined;
71
+ /**
72
+ * Facebook's public embed plugin for a post. Unlike the post page, it is
73
+ * meant to be rendered by third-party sites, so it still carries the
74
+ * media thumbnail when the post page withholds its Open Graph image from
75
+ * an unrecognized or datacenter client. Video posts (reels, watch) use
76
+ * the video plugin; everything else the post plugin.
77
+ */
78
+ export declare function resolveFacebookEmbed(url: string, ogType: string | undefined): string | null;
79
+ /**
80
+ * The media thumbnail from a Facebook embed-plugin page: the first `<img>`
81
+ * served from Facebook's CDN. The plugin renders the post media before
82
+ * the author avatar, so the first CDN image is the thumbnail.
83
+ */
84
+ export declare function extractFacebookEmbedImage(html: string): string | undefined;
63
85
  /**
64
86
  * True for Reddit URLs (including redd.it short links). Reddit serves its
65
87
  * Open Graph tags — with the post's real preview image — only to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sockethub/platform-metadata",
3
- "version": "1.0.1-beta.0",
3
+ "version": "1.0.1-beta.1",
4
4
  "description": "Fetch metadata from a given URL",
5
5
  "author": "Nick Jennings <nick@silverbucket.net>",
6
6
  "license": "LGPL-3.0+",
@@ -42,16 +42,16 @@
42
42
  "clean:deps": "rm -rf node_modules"
43
43
  },
44
44
  "dependencies": {
45
- "@sockethub/util": "^1.0.0-beta.0",
45
+ "@sockethub/util": "^1.0.0-beta.1",
46
46
  "open-graph-scraper": "^6.11.0",
47
47
  "undici": "^7.30.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@sockethub/schemas": "^3.0.0-beta.0"
50
+ "@sockethub/schemas": "^3.0.0-beta.1"
51
51
  },
52
52
  "peerDependencies": {
53
- "@sockethub/server": "^5.0.0-beta.0"
53
+ "@sockethub/server": "^5.0.0-beta.1"
54
54
  },
55
- "gitHead": "a17e337ee7d2dd496d225c0d6e8ae48f4f4ce73c",
55
+ "gitHead": "928f0c480e4828f492fb29a97712474a8f1bcaef",
56
56
  "types": "./dist/index.d.ts"
57
57
  }