@sockethub/platform-metadata 1.0.1-beta.2 → 1.0.1-beta.4
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/README.md +4 -0
- package/dist/index.js +72 -11
- package/dist/index.js.map +4 -4
- package/dist/resolvers.d.ts +21 -0
- package/package.json +5 -5
package/dist/resolvers.d.ts
CHANGED
|
@@ -35,6 +35,13 @@ export declare function extractYouTubeDescription(html: string): string | undefi
|
|
|
35
35
|
* with COMPAT_USER_AGENT (see index.ts), like Reddit.
|
|
36
36
|
*/
|
|
37
37
|
export declare function isFacebookUrl(url: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* True for Amazon storefront URLs and their short links. Amazon answers
|
|
40
|
+
* unrecognized scrapers (our own UA, and the Discordbot compat UA) with a
|
|
41
|
+
* captcha page or a generic "Amazon" share card; it serves the product's
|
|
42
|
+
* Open Graph title and image to WhatsApp's link-preview crawler.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isAmazonUrl(url: string): boolean;
|
|
38
45
|
/**
|
|
39
46
|
* Remove the engagement-stats segment Facebook prepends to video titles:
|
|
40
47
|
* "2.2M views · 21K reactions | <video title> | <author>". The stats are
|
|
@@ -105,6 +112,20 @@ export interface RedditPost {
|
|
|
105
112
|
};
|
|
106
113
|
}>;
|
|
107
114
|
};
|
|
115
|
+
/** Gallery posts carry no `preview`; their images live here instead. */
|
|
116
|
+
gallery_data?: {
|
|
117
|
+
items?: Array<{
|
|
118
|
+
media_id?: string;
|
|
119
|
+
}>;
|
|
120
|
+
};
|
|
121
|
+
media_metadata?: Record<string, {
|
|
122
|
+
s?: {
|
|
123
|
+
u?: string;
|
|
124
|
+
gif?: string;
|
|
125
|
+
x?: number;
|
|
126
|
+
y?: number;
|
|
127
|
+
};
|
|
128
|
+
}>;
|
|
108
129
|
}
|
|
109
130
|
/** Validate and extract the post object from Reddit's listing response. */
|
|
110
131
|
export declare function parseRedditPost(value: unknown): RedditPost | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockethub/platform-metadata",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.4",
|
|
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.
|
|
45
|
+
"@sockethub/util": "^1.0.0-beta.4",
|
|
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.
|
|
50
|
+
"@sockethub/schemas": "^3.0.0-beta.4"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@sockethub/server": "^5.0.0-beta.
|
|
53
|
+
"@sockethub/server": "^5.0.0-beta.4"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "2839403a8add67c25f39e164d4ba24ddb8a7ed3e",
|
|
56
56
|
"types": "./dist/index.d.ts"
|
|
57
57
|
}
|