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

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.
@@ -1,21 +1,4 @@
1
- /**
2
- * Site-specific URL resolution for pages that don't serve useful Open Graph
3
- * data to scrapers.
4
- *
5
- * Some large platforms return a generic banner image (X/Twitter), serve
6
- * their Open Graph data only to recognized embed crawlers (Reddit), or
7
- * hide post media behind a login (Facebook):
8
- *
9
- * - X/Twitter → FxTwitter's JSON API (api.fxtwitter.com), built for embed
10
- * previews, returns the tweet text plus direct photo/video URLs.
11
- * - Reddit → the regular scrape works, but only when presented with an
12
- * embed-crawler user agent (see COMPAT_USER_AGENT in index.ts).
13
- * - Facebook → same crawler-UA gating as Reddit, plus its video titles
14
- * arrive polluted with localized engagement stats that need stripping.
15
- *
16
- * These are pure URL matchers/mappers — the platform decides what to do
17
- * with the resolution (call a JSON API vs. pick a scrape user agent).
18
- */
1
+ import type { PageEvent } from "./event";
19
2
  /**
20
3
  * Match an X/Twitter status URL and return the FxTwitter API URL for it,
21
4
  * or null when the URL isn't a status page (profiles, search, home feed —
@@ -221,6 +204,7 @@ export interface PageObject {
221
204
  url?: string;
222
205
  favicon?: string;
223
206
  charset?: string;
207
+ event?: PageEvent;
224
208
  }
225
209
  /**
226
210
  * Map an FxTwitter API response onto the platform's page object. The
package/dist/schema.d.ts CHANGED
@@ -107,6 +107,31 @@ export declare const PlatformMetadataSchema: {
107
107
  charset: {
108
108
  type: string;
109
109
  };
110
+ event: {
111
+ type: string;
112
+ required: string[];
113
+ additionalProperties: boolean;
114
+ properties: {
115
+ name: {
116
+ type: string;
117
+ };
118
+ startDate: {
119
+ type: string;
120
+ };
121
+ endDate: {
122
+ type: string;
123
+ };
124
+ location: {
125
+ type: string;
126
+ };
127
+ url: {
128
+ type: string;
129
+ };
130
+ status: {
131
+ enum: string[];
132
+ };
133
+ };
134
+ };
110
135
  };
111
136
  };
112
137
  ogImage: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sockethub/platform-metadata",
3
- "version": "1.0.1-beta.1",
3
+ "version": "1.0.1-beta.3",
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.1",
45
+ "@sockethub/util": "^1.0.0-beta.3",
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.1"
50
+ "@sockethub/schemas": "^3.0.0-beta.3"
51
51
  },
52
52
  "peerDependencies": {
53
- "@sockethub/server": "^5.0.0-beta.1"
53
+ "@sockethub/server": "^5.0.0-beta.3"
54
54
  },
55
- "gitHead": "928f0c480e4828f492fb29a97712474a8f1bcaef",
55
+ "gitHead": "603d4edd90e1f0f0b70c4ab759be5f70b24020ea",
56
56
  "types": "./dist/index.d.ts"
57
57
  }