twitter-snap 0.0.58 → 0.0.59
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 +41 -0
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,6 +34,47 @@ npx twitter-snap@latest --theme MediaOnly https://x.com/elonmusk/status/13491296
|
|
|
34
34
|
|
|
35
35
|
`npm -g i twitter-snap@latest`
|
|
36
36
|
|
|
37
|
+
## Docker
|
|
38
|
+
|
|
39
|
+
```shell
|
|
40
|
+
docker run -it --rm -v $(pwd)/output:/app/output ghcr.io/fa0311/twitter-snap/twitter-snap-docker:latest https://x.com/elonmusk/status/1349129669258448897
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
docker run -it --rm -v $(pwd)/output:/app/output -v $(pwd)/cookies.json:/app/cookies.json twitter-snap https://x.com/elonmusk/status/1349129669258448897 --session-type file
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`--session-type=browser` is not supported.
|
|
48
|
+
|
|
49
|
+
`GPU` is not supported.
|
|
50
|
+
|
|
51
|
+
# Use as a package
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
npm i twitter-snap
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import {getFonts, twitterSnapGuest} from 'twitter-snap'
|
|
59
|
+
|
|
60
|
+
const id = '1349129669258448897'
|
|
61
|
+
const [client, api] = await twitterSnapGuest() // or twitterSnapCookies or twitterSnapPuppeteer
|
|
62
|
+
const fonts = await getFonts('.cache/fonts')
|
|
63
|
+
await client({id: id, limit: 1, type: 'getTweetDetail', startId: id}, async (render) => {
|
|
64
|
+
const finalize = await render({
|
|
65
|
+
output: `temp/${id}.{if-photo:png:mp4}`,
|
|
66
|
+
themeName: 'RenderOceanBlueColor',
|
|
67
|
+
themeParam: {
|
|
68
|
+
fonts: fonts,
|
|
69
|
+
width: 1440,
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
await finalize({cleanup: true})
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Also, if you use advanced customization, please use [twitter-snap-core](https://github.com/fa0311/twitter-snap-core).
|
|
77
|
+
|
|
37
78
|
## Arguments
|
|
38
79
|
|
|
39
80
|
```shell
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twitter-snap",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"description": "Create beautiful Tweet images fast",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"twitter",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"ora": "^8.1.0",
|
|
71
71
|
"puppeteer": "^23.6.1",
|
|
72
72
|
"twitter-openapi-typescript": "^0.0.44",
|
|
73
|
-
"twitter-snap-core": "^0.0.
|
|
73
|
+
"twitter-snap-core": "^0.0.42"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@oclif/prettier-config": "^0.2.1",
|