twitter-snap 0.0.13 → 0.0.14
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/dist/app/api/twitter/route.d.ts +2 -2
- package/dist/app/api/twitter/route.js +18 -18
- package/dist/app/layout.d.ts +6 -6
- package/dist/app/layout.js +10 -10
- package/dist/app/page.d.ts +1 -1
- package/dist/app/page.js +22 -22
- package/dist/app/page.js.map +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +37 -37
- package/dist/core/twitterSnap.d.ts +48 -47
- package/dist/core/twitterSnap.d.ts.map +1 -1
- package/dist/core/twitterSnap.js +61 -61
- package/dist/core/twitterSnap.js.map +1 -1
- package/dist/theme/normal.d.ts +3 -3
- package/dist/theme/normal.d.ts.map +1 -1
- package/dist/theme/normal.js +51 -50
- package/dist/theme/normal.js.map +1 -1
- package/dist/theme/normalComponent.d.ts +3 -3
- package/dist/theme/normalComponent.js +255 -255
- package/dist/theme/normalComponent.js.map +1 -1
- package/dist/theme/normalUtils.d.ts +18 -16
- package/dist/theme/normalUtils.d.ts.map +1 -1
- package/dist/theme/normalUtils.js +114 -110
- package/dist/theme/normalUtils.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/cookies.d.ts +1 -1
- package/dist/utils/cookies.js +14 -14
- package/dist/utils/fonts.d.ts +4 -4
- package/dist/utils/fonts.js +12 -12
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NextRequest } from "next/server";
|
|
2
|
-
export declare function GET(req: NextRequest): Promise<Response>;
|
|
1
|
+
import { NextRequest } from "next/server";
|
|
2
|
+
export declare function GET(req: NextRequest): Promise<Response>;
|
|
3
3
|
//# sourceMappingURL=route.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { TwitterOpenApi } from "twitter-openapi-typescript";
|
|
2
|
-
const guest = new TwitterOpenApi().getGuestClient();
|
|
3
|
-
export async function GET(req) {
|
|
4
|
-
const { searchParams } = new URL(req.url);
|
|
5
|
-
const id = searchParams.get("id");
|
|
6
|
-
const client = await guest;
|
|
7
|
-
if (!id) {
|
|
8
|
-
return new Response("Missing id", { status: 400 });
|
|
9
|
-
}
|
|
10
|
-
const tweet = await client.getDefaultApi().getTweetResultByRestId({
|
|
11
|
-
tweetId: id,
|
|
12
|
-
});
|
|
13
|
-
return new Response(JSON.stringify(tweet), {
|
|
14
|
-
headers: {
|
|
15
|
-
"content-type": "application/json",
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
}
|
|
1
|
+
import { TwitterOpenApi } from "twitter-openapi-typescript";
|
|
2
|
+
const guest = new TwitterOpenApi().getGuestClient();
|
|
3
|
+
export async function GET(req) {
|
|
4
|
+
const { searchParams } = new URL(req.url);
|
|
5
|
+
const id = searchParams.get("id");
|
|
6
|
+
const client = await guest;
|
|
7
|
+
if (!id) {
|
|
8
|
+
return new Response("Missing id", { status: 400 });
|
|
9
|
+
}
|
|
10
|
+
const tweet = await client.getDefaultApi().getTweetResultByRestId({
|
|
11
|
+
tweetId: id,
|
|
12
|
+
});
|
|
13
|
+
return new Response(JSON.stringify(tweet), {
|
|
14
|
+
headers: {
|
|
15
|
+
"content-type": "application/json",
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=route.js.map
|
package/dist/app/layout.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { Metadata } from "next";
|
|
3
|
-
export declare const metadata: Metadata;
|
|
4
|
-
export default function RootLayout({ children, }: {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Metadata } from "next";
|
|
3
|
+
export declare const metadata: Metadata;
|
|
4
|
+
export default function RootLayout({ children, }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=layout.d.ts.map
|
package/dist/app/layout.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Inter } from "next/font/google";
|
|
3
|
-
const inter = Inter({ subsets: ["latin"] });
|
|
4
|
-
export const metadata = {
|
|
5
|
-
title: "Create Next App",
|
|
6
|
-
description: "Generated by create next app",
|
|
7
|
-
};
|
|
8
|
-
export default function RootLayout({ children, }) {
|
|
9
|
-
return (_jsx("html", { lang: "en", children: _jsx("body", { className: inter.className, style: { margin: 0 }, children: children }) }));
|
|
10
|
-
}
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Inter } from "next/font/google";
|
|
3
|
+
const inter = Inter({ subsets: ["latin"] });
|
|
4
|
+
export const metadata = {
|
|
5
|
+
title: "Create Next App",
|
|
6
|
+
description: "Generated by create next app",
|
|
7
|
+
};
|
|
8
|
+
export default function RootLayout({ children, }) {
|
|
9
|
+
return (_jsx("html", { lang: "en", children: _jsx("body", { className: inter.className, style: { margin: 0 }, children: children }) }));
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=layout.js.map
|
package/dist/app/page.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default function Home(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export default function Home(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=page.d.ts.map
|
package/dist/app/page.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect } from "react";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import NormalComponent from "./../theme/normalComponent";
|
|
6
|
-
export default function Home() {
|
|
7
|
-
const toAPi = (e) => `/api/twitter?id=${e}`;
|
|
8
|
-
const toId = (e) => (isNaN(Number(e)) ? e.split("/").pop() : e);
|
|
9
|
-
const [state, setState] = useState(null);
|
|
10
|
-
const [id, setId] = useState("1518623997054918657");
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
fetch(toAPi(toId(id)))
|
|
13
|
-
.then((e) => e.json())
|
|
14
|
-
.then((e) => setState(e.data));
|
|
15
|
-
}, [id]);
|
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsx("input", { value: id, onChange: (e) => setId(e.target.value) }), state && (_jsx("div", { style: {
|
|
17
|
-
width: "600px",
|
|
18
|
-
display: "flex",
|
|
19
|
-
justifyContent: "center",
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
}, children: _jsx(NormalComponent, { data: state, video: false }) }))] }));
|
|
22
|
-
}
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import NormalComponent from "./../theme/normalComponent";
|
|
6
|
+
export default function Home() {
|
|
7
|
+
const toAPi = (e) => `/api/twitter?id=${e}`;
|
|
8
|
+
const toId = (e) => (isNaN(Number(e)) ? e.split("/").pop() : e);
|
|
9
|
+
const [state, setState] = useState(null);
|
|
10
|
+
const [id, setId] = useState("1518623997054918657");
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
fetch(toAPi(toId(id)))
|
|
13
|
+
.then((e) => e.json())
|
|
14
|
+
.then((e) => setState(e.data));
|
|
15
|
+
}, [id]);
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsx("input", { value: id, onChange: (e) => setId(e.target.value) }), state && (_jsx("div", { style: {
|
|
17
|
+
width: "600px",
|
|
18
|
+
display: "flex",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
}, children: _jsx(NormalComponent, { data: state, video: false, width: 600 }) }))] }));
|
|
22
|
+
}
|
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,CAAC,CAAC,CAAC;IACnC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACT,OAAO,CACL,8BACE,gBAAO,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,EAC3D,KAAK,IAAI,CACR,cACE,KAAK,EAAE;oBACL,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,MAAM;oBACf,cAAc,EAAE,QAAQ;oBACxB,UAAU,EAAE,QAAQ;iBACrB,YAED,KAAC,eAAe,IAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,GAAI,GACtD,CACP,IACA,CACJ,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export {};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
|
3
3
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { TwitterSnap } from "./core/twitterSnap.js";
|
|
3
|
-
import { Command } from "commander";
|
|
4
|
-
import { getClient } from "./utils/cookies.js";
|
|
5
|
-
import { getFonts } from "./utils/fonts.js";
|
|
6
|
-
const version = "0.0.10";
|
|
7
|
-
const program = new Command();
|
|
8
|
-
program.name("twitter-snap").version(version);
|
|
9
|
-
const emoji = "(twemoji, openmoji, blobmoji, noto, fluent, fluentFlat)";
|
|
10
|
-
program
|
|
11
|
-
.argument("<string>", "tweet url or tweet id")
|
|
12
|
-
.option("-o, --output <path>", "output file path", "output.png")
|
|
13
|
-
.option("-w, --width <number>", "image width", "600")
|
|
14
|
-
.option("-h, --height <number>", "image height")
|
|
15
|
-
.option("-t, --theme <string>", Object.keys(TwitterSnap.themes).join())
|
|
16
|
-
.option("--margin <number>", "margin")
|
|
17
|
-
.option("--fonts <path>", "font config file path .json")
|
|
18
|
-
.option("--emoji <string>", `emoji type ${emoji}`, "twemoji")
|
|
19
|
-
.option("--cookies <path>", "net escape cookie file path .txt")
|
|
20
|
-
.option("--auto-photo", "if the tweet is not a video, save it as an image")
|
|
21
|
-
.option("--no-remove-temp", "no remove temp file")
|
|
22
|
-
.action(async (text, param) => {
|
|
23
|
-
const id = isNaN(text) ? text.split("/").pop() : text;
|
|
24
|
-
const twitterSnap = new TwitterSnap({
|
|
25
|
-
width: parseInt(param.width),
|
|
26
|
-
height: param.height ? parseInt(param.height) : undefined,
|
|
27
|
-
client: param.cookies ? await getClient(param.cookies) : undefined,
|
|
28
|
-
themeName: param.theme,
|
|
29
|
-
fonts: param.fonts ? await getFonts(param.fonts) : undefined,
|
|
30
|
-
emoji: param.emoji ? param.emoji : undefined,
|
|
31
|
-
autoPhoto: param.autoPhoto ? true : false,
|
|
32
|
-
removeTemp: param.removeTemp ? true : false,
|
|
33
|
-
});
|
|
34
|
-
await twitterSnap.render({ output: param.output, id });
|
|
35
|
-
process.exit(0);
|
|
36
|
-
});
|
|
37
|
-
program.parse(process.argv);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { TwitterSnap } from "./core/twitterSnap.js";
|
|
3
|
+
import { Command } from "commander";
|
|
4
|
+
import { getClient } from "./utils/cookies.js";
|
|
5
|
+
import { getFonts } from "./utils/fonts.js";
|
|
6
|
+
const version = "0.0.10";
|
|
7
|
+
const program = new Command();
|
|
8
|
+
program.name("twitter-snap").version(version);
|
|
9
|
+
const emoji = "(twemoji, openmoji, blobmoji, noto, fluent, fluentFlat)";
|
|
10
|
+
program
|
|
11
|
+
.argument("<string>", "tweet url or tweet id")
|
|
12
|
+
.option("-o, --output <path>", "output file path", "output.png")
|
|
13
|
+
.option("-w, --width <number>", "image width", "600")
|
|
14
|
+
.option("-h, --height <number>", "image height")
|
|
15
|
+
.option("-t, --theme <string>", Object.keys(TwitterSnap.themes).join())
|
|
16
|
+
.option("--margin <number>", "margin")
|
|
17
|
+
.option("--fonts <path>", "font config file path .json")
|
|
18
|
+
.option("--emoji <string>", `emoji type ${emoji}`, "twemoji")
|
|
19
|
+
.option("--cookies <path>", "net escape cookie file path .txt")
|
|
20
|
+
.option("--auto-photo", "if the tweet is not a video, save it as an image")
|
|
21
|
+
.option("--no-remove-temp", "no remove temp file")
|
|
22
|
+
.action(async (text, param) => {
|
|
23
|
+
const id = isNaN(text) ? text.split("/").pop() : text;
|
|
24
|
+
const twitterSnap = new TwitterSnap({
|
|
25
|
+
width: parseInt(param.width),
|
|
26
|
+
height: param.height ? parseInt(param.height) : undefined,
|
|
27
|
+
client: param.cookies ? await getClient(param.cookies) : undefined,
|
|
28
|
+
themeName: param.theme,
|
|
29
|
+
fonts: param.fonts ? await getFonts(param.fonts) : undefined,
|
|
30
|
+
emoji: param.emoji ? param.emoji : undefined,
|
|
31
|
+
autoPhoto: param.autoPhoto ? true : false,
|
|
32
|
+
removeTemp: param.removeTemp ? true : false,
|
|
33
|
+
});
|
|
34
|
+
await twitterSnap.render({ output: param.output, id });
|
|
35
|
+
process.exit(0);
|
|
36
|
+
});
|
|
37
|
+
program.parse(process.argv);
|
|
38
38
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
import { ImageResponse } from "@vercel/og";
|
|
3
|
-
import { ImageResponseOptions } from "@vercel/og/dist/types";
|
|
4
|
-
import { TwitterOpenApiClient, TweetApiUtilsData } from "twitter-openapi-typescript";
|
|
5
|
-
export type ThemeComponent = (props: {
|
|
6
|
-
data: TweetApiUtilsData;
|
|
7
|
-
param: TwitterSnapParams;
|
|
8
|
-
video: boolean;
|
|
9
|
-
}) => {
|
|
10
|
-
writePhoto: (props: {
|
|
11
|
-
output: string;
|
|
12
|
-
data: ImageResponse;
|
|
13
|
-
}) => Promise<void>;
|
|
14
|
-
writeVideo: (props: {
|
|
15
|
-
output: string;
|
|
16
|
-
data: ImageResponse;
|
|
17
|
-
}) => Promise<void>;
|
|
18
|
-
element: ReactElement;
|
|
19
|
-
};
|
|
20
|
-
export type Component = (props: {
|
|
21
|
-
data: TweetApiUtilsData;
|
|
22
|
-
video: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { ImageResponse } from "@vercel/og";
|
|
3
|
+
import { ImageResponseOptions } from "@vercel/og/dist/types";
|
|
4
|
+
import { TwitterOpenApiClient, TweetApiUtilsData } from "twitter-openapi-typescript";
|
|
5
|
+
export type ThemeComponent = (props: {
|
|
6
|
+
data: TweetApiUtilsData;
|
|
7
|
+
param: TwitterSnapParams;
|
|
8
|
+
video: boolean;
|
|
9
|
+
}) => {
|
|
10
|
+
writePhoto: (props: {
|
|
11
|
+
output: string;
|
|
12
|
+
data: ImageResponse;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
writeVideo: (props: {
|
|
15
|
+
output: string;
|
|
16
|
+
data: ImageResponse;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
element: ReactElement;
|
|
19
|
+
};
|
|
20
|
+
export type Component = (props: {
|
|
21
|
+
data: TweetApiUtilsData;
|
|
22
|
+
video: boolean;
|
|
23
|
+
width: number;
|
|
24
|
+
}) => ReactElement;
|
|
25
|
+
export type TwitterSnapParams = {
|
|
26
|
+
width: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
client?: TwitterOpenApiClient;
|
|
29
|
+
themeName?: string;
|
|
30
|
+
fonts?: ImageResponseOptions["fonts"];
|
|
31
|
+
emoji?: ImageResponseOptions["emoji"];
|
|
32
|
+
autoPhoto: boolean;
|
|
33
|
+
removeTemp: boolean;
|
|
34
|
+
};
|
|
35
|
+
type TwitterSnapRenderParams = {
|
|
36
|
+
output: string;
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
export declare class TwitterSnap {
|
|
40
|
+
private param;
|
|
41
|
+
static themes: {
|
|
42
|
+
[key: string]: ThemeComponent;
|
|
43
|
+
};
|
|
44
|
+
constructor(param: TwitterSnapParams);
|
|
45
|
+
getClient: () => Promise<TwitterOpenApiClient>;
|
|
46
|
+
render: ({ output, id }: TwitterSnapRenderParams) => Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
48
49
|
//# sourceMappingURL=twitterSnap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitterSnap.d.ts","sourceRoot":"","sources":["../../src/core/twitterSnap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAEL,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAGpC,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE;IACnC,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;CAChB,KAAK;IACJ,UAAU,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,aAAa,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,UAAU,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC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AAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,qBAAa,WAAW;IAKV,OAAO,CAAC,KAAK;IAJzB,MAAM,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAE9C;gBAEkB,KAAK,EAAE,iBAAiB;IAE5C,SAAS,sCAGP;IAEF,MAAM,mBAA0B,uBAAuB,mBA2CrD;CACH"}
|
package/dist/core/twitterSnap.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import Normal from "./../theme/normal.js";
|
|
2
|
-
import { ImageResponse } from "@vercel/og";
|
|
3
|
-
import { TwitterOpenApi, } from "twitter-openapi-typescript";
|
|
4
|
-
import path from "path";
|
|
5
|
-
export class TwitterSnap {
|
|
6
|
-
constructor(param) {
|
|
7
|
-
this.param = param;
|
|
8
|
-
this.getClient = async () => {
|
|
9
|
-
if (this.param.client)
|
|
10
|
-
return this.param.client;
|
|
11
|
-
return await new TwitterOpenApi().getGuestClient();
|
|
12
|
-
};
|
|
13
|
-
this.render = async ({ output, id }) => {
|
|
14
|
-
const api = (await this.getClient()).getDefaultApi();
|
|
15
|
-
const tweet = await api.getTweetResultByRestId({
|
|
16
|
-
tweetId: id,
|
|
17
|
-
});
|
|
18
|
-
const extEntities = tweet.data.tweet.legacy.extendedEntities;
|
|
19
|
-
const extMedia = extEntities?.media ?? [];
|
|
20
|
-
const videoInfo = !!extMedia.find((e) => e.type !== "photo");
|
|
21
|
-
const o = path.parse(output);
|
|
22
|
-
const video = (() => {
|
|
23
|
-
if (this.param.autoPhoto) {
|
|
24
|
-
if (videoInfo) {
|
|
25
|
-
return o.ext !== ".png";
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return o.ext !== ".png";
|
|
33
|
-
}
|
|
34
|
-
})();
|
|
35
|
-
const theme = TwitterSnap.themes[this.param.themeName || "normal"];
|
|
36
|
-
const { element, writePhoto, writeVideo } = theme({
|
|
37
|
-
data: tweet.data,
|
|
38
|
-
param: this.param,
|
|
39
|
-
video: video,
|
|
40
|
-
});
|
|
41
|
-
const data = new ImageResponse(element, {
|
|
42
|
-
width: this.param.width,
|
|
43
|
-
height: this.param.height,
|
|
44
|
-
fonts: this.param.fonts,
|
|
45
|
-
emoji: this.param.emoji,
|
|
46
|
-
});
|
|
47
|
-
if (video) {
|
|
48
|
-
return writeVideo({ output, data });
|
|
49
|
-
}
|
|
50
|
-
else if (o.ext !== ".png") {
|
|
51
|
-
return writePhoto({ output: path.join(o.dir, `${o.name}.png`), data });
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return writePhoto({ output, data });
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
TwitterSnap.themes = {
|
|
60
|
-
normal: Normal,
|
|
61
|
-
};
|
|
1
|
+
import Normal from "./../theme/normal.js";
|
|
2
|
+
import { ImageResponse } from "@vercel/og";
|
|
3
|
+
import { TwitterOpenApi, } from "twitter-openapi-typescript";
|
|
4
|
+
import path from "path";
|
|
5
|
+
export class TwitterSnap {
|
|
6
|
+
constructor(param) {
|
|
7
|
+
this.param = param;
|
|
8
|
+
this.getClient = async () => {
|
|
9
|
+
if (this.param.client)
|
|
10
|
+
return this.param.client;
|
|
11
|
+
return await new TwitterOpenApi().getGuestClient();
|
|
12
|
+
};
|
|
13
|
+
this.render = async ({ output, id }) => {
|
|
14
|
+
const api = (await this.getClient()).getDefaultApi();
|
|
15
|
+
const tweet = await api.getTweetResultByRestId({
|
|
16
|
+
tweetId: id,
|
|
17
|
+
});
|
|
18
|
+
const extEntities = tweet.data.tweet.legacy.extendedEntities;
|
|
19
|
+
const extMedia = extEntities?.media ?? [];
|
|
20
|
+
const videoInfo = !!extMedia.find((e) => e.type !== "photo");
|
|
21
|
+
const o = path.parse(output);
|
|
22
|
+
const video = (() => {
|
|
23
|
+
if (this.param.autoPhoto) {
|
|
24
|
+
if (videoInfo) {
|
|
25
|
+
return o.ext !== ".png";
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return o.ext !== ".png";
|
|
33
|
+
}
|
|
34
|
+
})();
|
|
35
|
+
const theme = TwitterSnap.themes[this.param.themeName || "normal"];
|
|
36
|
+
const { element, writePhoto, writeVideo } = theme({
|
|
37
|
+
data: tweet.data,
|
|
38
|
+
param: this.param,
|
|
39
|
+
video: video,
|
|
40
|
+
});
|
|
41
|
+
const data = new ImageResponse(element, {
|
|
42
|
+
width: this.param.width,
|
|
43
|
+
height: this.param.height,
|
|
44
|
+
fonts: this.param.fonts,
|
|
45
|
+
emoji: this.param.emoji,
|
|
46
|
+
});
|
|
47
|
+
if (video) {
|
|
48
|
+
return writeVideo({ output, data });
|
|
49
|
+
}
|
|
50
|
+
else if (o.ext !== ".png") {
|
|
51
|
+
return writePhoto({ output: path.join(o.dir, `${o.name}.png`), data });
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return writePhoto({ output, data });
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
TwitterSnap.themes = {
|
|
60
|
+
normal: Normal,
|
|
61
|
+
};
|
|
62
62
|
//# sourceMappingURL=twitterSnap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitterSnap.js","sourceRoot":"","sources":["../../src/core/twitterSnap.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,cAAc,GAGf,MAAM,4BAA4B,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"twitterSnap.js","sourceRoot":"","sources":["../../src/core/twitterSnap.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,cAAc,GAGf,MAAM,4BAA4B,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAkCxB,MAAM,OAAO,WAAW;IAKtB,YAAoB,KAAwB;QAAxB,UAAK,GAAL,KAAK,CAAmB;QAE5C,cAAS,GAAG,KAAK,IAAI,EAAE;YACrB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YAChD,OAAO,MAAM,IAAI,cAAc,EAAE,CAAC,cAAc,EAAE,CAAC;QACrD,CAAC,CAAC;QAEF,WAAM,GAAG,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAA2B,EAAE,EAAE;YACzD,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC;YACrD,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,sBAAsB,CAAC;gBAC7C,OAAO,EAAE,EAAE;aACZ,CAAC,CAAC;YAEH,MAAM,WAAW,GAAG,KAAK,CAAC,IAAK,CAAC,KAAK,CAAC,MAAO,CAAC,gBAAgB,CAAC;YAC/D,MAAM,QAAQ,GAAG,WAAW,EAAE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AM,EAAE;gBAC3B,OAAO,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;aACxE;iBAAM;gBACL,OAAO,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aACrC;QACH,CAAC,CAAC;IAlD6C,CAAC;;AAJzC,kBAAM,GAAsC;IACjD,MAAM,EAAE,MAAM;CACf,CAAC"}
|
package/dist/theme/normal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeComponent } from "./../core/twitterSnap.js";
|
|
2
|
-
declare const Normal: ThemeComponent;
|
|
3
|
-
export default Normal;
|
|
1
|
+
import { ThemeComponent } from "./../core/twitterSnap.js";
|
|
2
|
+
declare const Normal: ThemeComponent;
|
|
3
|
+
export default Normal;
|
|
4
4
|
//# sourceMappingURL=normal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normal.d.ts","sourceRoot":"","sources":["../../src/theme/normal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO1D,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"normal.d.ts","sourceRoot":"","sources":["../../src/theme/normal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO1D,QAAA,MAAM,MAAM,EAAE,cAsDb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/theme/normal.js
CHANGED
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import NormalComponent from "./normalComponent.js";
|
|
3
|
-
import { getBiggerMedia, videoConverter } from "./normalUtils.js";
|
|
4
|
-
import fs from "fs/promises";
|
|
5
|
-
import path from "path";
|
|
6
|
-
const Normal = ({ data, param, video }) => {
|
|
7
|
-
const extEntities = data.tweet.legacy.extendedEntities;
|
|
8
|
-
const extMedia = extEntities?.media ?? [];
|
|
9
|
-
const v = extMedia.filter((e) => e.type !== "photo");
|
|
10
|
-
const screenName = data.user.legacy.screenName;
|
|
11
|
-
const id = data.tweet.legacy.idStr;
|
|
12
|
-
const title = `https://twitter.com/${screenName}/status/${id}`;
|
|
13
|
-
return {
|
|
14
|
-
element: _jsx(NormalComponent, { data: data, video: video }),
|
|
15
|
-
writePhoto: async ({ output, data }) => {
|
|
16
|
-
const png = Buffer.from(await data.arrayBuffer());
|
|
17
|
-
await fs.writeFile(output, png);
|
|
18
|
-
},
|
|
19
|
-
writeVideo: async ({ output, data }) => {
|
|
20
|
-
const o = path.parse(output);
|
|
21
|
-
const margin = 20 + 12;
|
|
22
|
-
const { width, height } = getBiggerMedia(extEntities?.media ?? [], margin);
|
|
23
|
-
const video = v.map((e) => {
|
|
24
|
-
return [...e.videoInfo.variants].sort((a, b) => {
|
|
25
|
-
if (a.bitrate === undefined)
|
|
26
|
-
return -1;
|
|
27
|
-
if (b.bitrate === undefined)
|
|
28
|
-
return 1;
|
|
29
|
-
return b.bitrate - a.bitrate;
|
|
30
|
-
})[0];
|
|
31
|
-
});
|
|
32
|
-
const png = Buffer.from(await data.arrayBuffer());
|
|
33
|
-
const name = path.join(o.dir, `temp-${o.name}.png`);
|
|
34
|
-
await fs.writeFile(name, png);
|
|
35
|
-
const removeTemp = param.removeTemp;
|
|
36
|
-
const args = {
|
|
37
|
-
video,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
await
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import NormalComponent from "./normalComponent.js";
|
|
3
|
+
import { getBiggerMedia, videoConverter } from "./normalUtils.js";
|
|
4
|
+
import fs from "fs/promises";
|
|
5
|
+
import path from "path";
|
|
6
|
+
const Normal = ({ data, param, video }) => {
|
|
7
|
+
const extEntities = data.tweet.legacy.extendedEntities;
|
|
8
|
+
const extMedia = extEntities?.media ?? [];
|
|
9
|
+
const v = extMedia.filter((e) => e.type !== "photo");
|
|
10
|
+
const screenName = data.user.legacy.screenName;
|
|
11
|
+
const id = data.tweet.legacy.idStr;
|
|
12
|
+
const title = `https://twitter.com/${screenName}/status/${id}`;
|
|
13
|
+
return {
|
|
14
|
+
element: _jsx(NormalComponent, { data: data, video: video, width: param.width }),
|
|
15
|
+
writePhoto: async ({ output, data }) => {
|
|
16
|
+
const png = Buffer.from(await data.arrayBuffer());
|
|
17
|
+
await fs.writeFile(output, png);
|
|
18
|
+
},
|
|
19
|
+
writeVideo: async ({ output, data }) => {
|
|
20
|
+
const o = path.parse(output);
|
|
21
|
+
const margin = 20 + 12;
|
|
22
|
+
const { width, height, index } = getBiggerMedia(extEntities?.media ?? [], margin, param.width);
|
|
23
|
+
const video = v.map((e) => {
|
|
24
|
+
return [...e.videoInfo.variants].sort((a, b) => {
|
|
25
|
+
if (a.bitrate === undefined)
|
|
26
|
+
return -1;
|
|
27
|
+
if (b.bitrate === undefined)
|
|
28
|
+
return 1;
|
|
29
|
+
return b.bitrate - a.bitrate;
|
|
30
|
+
})[0];
|
|
31
|
+
});
|
|
32
|
+
const png = Buffer.from(await data.arrayBuffer());
|
|
33
|
+
const name = path.join(o.dir, `temp-${o.name}.png`);
|
|
34
|
+
await fs.writeFile(name, png);
|
|
35
|
+
const removeTemp = param.removeTemp;
|
|
36
|
+
const args = {
|
|
37
|
+
video,
|
|
38
|
+
index,
|
|
39
|
+
title,
|
|
40
|
+
output,
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
margin,
|
|
44
|
+
removeTemp,
|
|
45
|
+
};
|
|
46
|
+
await videoConverter(args);
|
|
47
|
+
await fs.unlink(name);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export default Normal;
|
|
51
52
|
//# sourceMappingURL=normal.js.map
|
package/dist/theme/normal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normal.js","sourceRoot":"","sources":["../../src/theme/normal.tsx"],"names":[],"mappings":";AAGA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,MAAM,GAAmB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAO,CAAC,gBAAgB,CAAC;IACxD,MAAM,QAAQ,GAAG,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC;IAC1C,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAErD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAO,CAAC,UAAU,CAAC;IAChD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAO,CAAC,KAAK,CAAC;IAEpC,MAAM,KAAK,GAAG,uBAAuB,UAAU,WAAW,EAAE,EAAE,CAAC;IAE/D,OAAO;QACL,OAAO,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI;
|
|
1
|
+
{"version":3,"file":"normal.js","sourceRoot":"","sources":["../../src/theme/normal.tsx"],"names":[],"mappings":";AAGA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElE,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Snap.js";
|
|
2
|
-
declare const NormalComponent: Component;
|
|
3
|
-
export default NormalComponent;
|
|
1
|
+
import { Component } from "./../core/twitterSnap.js";
|
|
2
|
+
declare const NormalComponent: Component;
|
|
3
|
+
export default NormalComponent;
|
|
4
4
|
//# sourceMappingURL=normalComponent.d.ts.map
|