first commit

This commit is contained in:
NAME
2026-05-11 03:18:19 +00:00
commit c72a38201a
37 changed files with 10182 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
// utils/x-headers.util.ts
export function buildXHeaders(authToken: string, ct0: string) {
return {
authority: 'x.com',
accept: '*/*',
'accept-language': 'en-US,en;q=0.9',
authorization: `Bearer ${process.env.X_BEARER_TOKEN}`,
'content-type': 'application/json',
cookie: `auth_token=${authToken}; ct0=${ct0};`,
origin: 'https://x.com',
referer: 'https://x.com/home',
host: 'api.x.com',
'user-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15',
'x-csrf-token': ct0,
'x-twitter-active-user': 'yes',
'x-twitter-auth-type': 'OAuth2Session',
'x-twitter-client-language': 'en',
};
}
export function buildXCookies() {
return [
{
name: "ct0",
value: process.env.X_COOKIE_CT0,
},
{
name: "auth_token",
value: process.env.X_COOKIE_AUTH_TOKEN,
},
{name: "lang", value: "en"},
];
}