triangle-utils 1.4.66 → 1.4.68
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/src/UtilsTwitter.d.ts +1 -0
- package/dist/src/UtilsTwitter.js +36 -4
- package/dist/src/UtilsXAI.d.ts +6 -0
- package/dist/src/UtilsXAI.js +40 -0
- package/dist/src/f.js +76 -55
- package/f.txt +0 -0
- package/package.json +1 -1
- package/src/UtilsTwitter.ts +36 -3
- package/src/UtilsXAI.ts +51 -0
- package/src/f.ts +80 -57
package/dist/src/UtilsTwitter.js
CHANGED
|
@@ -4,6 +4,38 @@ export class UtilsTwitter {
|
|
|
4
4
|
constructor(twitter_api_key) {
|
|
5
5
|
this.twitter = new Client({ bearerToken: twitter_api_key });
|
|
6
6
|
}
|
|
7
|
+
async get_user(user_id) {
|
|
8
|
+
const result = await this.twitter.users.getById(user_id, { userFields: [
|
|
9
|
+
"affiliation",
|
|
10
|
+
// "confirmed_email",
|
|
11
|
+
"connection_status",
|
|
12
|
+
"created_at",
|
|
13
|
+
"description",
|
|
14
|
+
"entities",
|
|
15
|
+
"id",
|
|
16
|
+
"is_identity_verified",
|
|
17
|
+
"location",
|
|
18
|
+
"most_recent_tweet_id",
|
|
19
|
+
"name",
|
|
20
|
+
"parody",
|
|
21
|
+
"pinned_tweet_id",
|
|
22
|
+
"profile_banner_url",
|
|
23
|
+
"profile_image_url",
|
|
24
|
+
"protected",
|
|
25
|
+
// "public_metrics",
|
|
26
|
+
// "receives_your_dm",
|
|
27
|
+
"subscription",
|
|
28
|
+
"subscription_type",
|
|
29
|
+
"url",
|
|
30
|
+
"username",
|
|
31
|
+
"verified",
|
|
32
|
+
"verified_followers_count",
|
|
33
|
+
"verified_type",
|
|
34
|
+
"withheld"
|
|
35
|
+
] })
|
|
36
|
+
.then(response => response.data);
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
7
39
|
async get_user_by_username(username) {
|
|
8
40
|
const result = await this.twitter.users.getByUsername(username, { userFields: [
|
|
9
41
|
"affiliation",
|
|
@@ -37,7 +69,7 @@ export class UtilsTwitter {
|
|
|
37
69
|
return result;
|
|
38
70
|
}
|
|
39
71
|
async get_tweets(user_id) {
|
|
40
|
-
const
|
|
72
|
+
const response = await this.twitter.users.getPosts(user_id, { tweetFields: [
|
|
41
73
|
"article",
|
|
42
74
|
"attachments",
|
|
43
75
|
"author_id",
|
|
@@ -68,8 +100,8 @@ export class UtilsTwitter {
|
|
|
68
100
|
"suggested_source_links_with_counts",
|
|
69
101
|
"text",
|
|
70
102
|
"withheld"
|
|
71
|
-
] })
|
|
72
|
-
|
|
73
|
-
return
|
|
103
|
+
] });
|
|
104
|
+
console.log("RESPONSE", response);
|
|
105
|
+
return response.data;
|
|
74
106
|
}
|
|
75
107
|
}
|
package/dist/src/UtilsXAI.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export interface GrokResponse {
|
|
|
18
18
|
export declare class UtilsXAI {
|
|
19
19
|
private readonly xai_api_key;
|
|
20
20
|
constructor(xai_api_key: string | undefined);
|
|
21
|
+
grok_simple_query(model_id: string, prompt: string, options?: {
|
|
22
|
+
max_tokens?: number;
|
|
23
|
+
print_usage?: boolean;
|
|
24
|
+
json_format?: Record<string, any>;
|
|
25
|
+
web?: boolean;
|
|
26
|
+
}): Promise<string | undefined>;
|
|
21
27
|
grok_query(model: string, prompt: string, conversation_history?: GrokMessage[], options?: {
|
|
22
28
|
require_sources: boolean;
|
|
23
29
|
}): Promise<GrokResponse | undefined>;
|
package/dist/src/UtilsXAI.js
CHANGED
|
@@ -28,6 +28,46 @@ export class UtilsXAI {
|
|
|
28
28
|
constructor(xai_api_key) {
|
|
29
29
|
this.xai_api_key = xai_api_key;
|
|
30
30
|
}
|
|
31
|
+
async grok_simple_query(model_id, prompt, options = {}) {
|
|
32
|
+
const response = await fetch("https://api.x.ai/v1/responses", {
|
|
33
|
+
method: "POST",
|
|
34
|
+
body: JSON.stringify({
|
|
35
|
+
model: model_id,
|
|
36
|
+
input: prompt,
|
|
37
|
+
tools: [
|
|
38
|
+
{
|
|
39
|
+
type: "x_search"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
temperature: 0,
|
|
43
|
+
max_output_tokens: options.max_tokens || 1000,
|
|
44
|
+
reasoning: {
|
|
45
|
+
effort: "low"
|
|
46
|
+
},
|
|
47
|
+
text: options.json_format !== undefined ? {
|
|
48
|
+
format: {
|
|
49
|
+
type: "json_schema",
|
|
50
|
+
name: "response",
|
|
51
|
+
strict: true,
|
|
52
|
+
schema: options.json_format
|
|
53
|
+
}
|
|
54
|
+
} : undefined
|
|
55
|
+
}),
|
|
56
|
+
headers: {
|
|
57
|
+
"Accept": "application/json",
|
|
58
|
+
"Content-type": "application/json",
|
|
59
|
+
"Authorization": "Bearer " + this.xai_api_key
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const output = await response.json();
|
|
63
|
+
if (options.print_usage !== undefined && options.print_usage) {
|
|
64
|
+
console.log(output.usage);
|
|
65
|
+
}
|
|
66
|
+
const content = output.output.at(-1).content;
|
|
67
|
+
const grok_message = content[0];
|
|
68
|
+
const text = grok_message.text;
|
|
69
|
+
return text;
|
|
70
|
+
}
|
|
31
71
|
async grok_query(model, prompt, conversation_history = [], options) {
|
|
32
72
|
const require_sources = options !== undefined ? options.require_sources : false;
|
|
33
73
|
if (this.xai_api_key === undefined) {
|
package/dist/src/f.js
CHANGED
|
@@ -1,20 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { SecretsManager } from "@aws-sdk/client-secrets-manager";
|
|
2
|
+
import { TriangleUtils } from "./index.js";
|
|
3
|
+
console.log("Starting triangle-utils!");
|
|
4
|
+
const secret_name = "elections_config";
|
|
5
|
+
const secrets_manager = new SecretsManager({ region: "us-east-1" });
|
|
6
|
+
const response = await secrets_manager.getSecretValue({
|
|
7
|
+
SecretId: secret_name
|
|
8
|
+
});
|
|
9
|
+
const api_keys = JSON.parse(response?.SecretString || "");
|
|
10
|
+
const config = {
|
|
11
|
+
google_email: "louishou@triangleanalytics.com",
|
|
12
|
+
alerts_email: "alerts@triangleanalytics.com",
|
|
13
|
+
region: "us-east-1",
|
|
14
|
+
...api_keys
|
|
15
|
+
};
|
|
16
|
+
console.log(config);
|
|
17
|
+
const utils = new TriangleUtils(config);
|
|
18
|
+
const text = await utils.xai.grok_simple_query("grok-4.3", "Find the X username corresponding to the candidate of the committee \"Darializa for Congress\"", {
|
|
19
|
+
print_usage: true,
|
|
20
|
+
json_format: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
username: {
|
|
24
|
+
type: "string"
|
|
25
|
+
},
|
|
26
|
+
explanation: {
|
|
27
|
+
type: "string"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
required: [
|
|
31
|
+
"username",
|
|
32
|
+
"explanation"
|
|
33
|
+
],
|
|
34
|
+
additionalProperties: false
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
console.log(text);
|
|
18
38
|
// const foods = await utils.dynamodb.query("triage_docket_documents:register_document_id", { register_document_id : "E6-17065" })
|
|
19
39
|
// console.log(foods)
|
|
20
40
|
// const text = await utils.bee.get("https://www.doyourjobs.org", { return_page_text : true })
|
|
@@ -49,9 +69,9 @@
|
|
|
49
69
|
// }
|
|
50
70
|
// )
|
|
51
71
|
// console.log(output)
|
|
52
|
-
import { Client } from "@xdevplatform/xdk"
|
|
53
|
-
const x = new Client({ bearerToken: "AAAAAAAAAAAAAAAAAAAAAKoQ%2BQEAAAAAaej7PP534%2Fd9dKmieHRY6vQkv2s%3DyY2VerXmrA7w794ACFr9ALvoaJfuAHSlWwZdiDeVaOVpA6HCub" })
|
|
54
|
-
// const user = await x.users.getByUsername("
|
|
72
|
+
// import { Client } from "@xdevplatform/xdk"
|
|
73
|
+
// const x = new Client({ bearerToken : "AAAAAAAAAAAAAAAAAAAAAKoQ%2BQEAAAAAaej7PP534%2Fd9dKmieHRY6vQkv2s%3DyY2VerXmrA7w794ACFr9ALvoaJfuAHSlWwZdiDeVaOVpA6HCub" })
|
|
74
|
+
// const user = await x.users.getByUsername("umichvoter", { userFields : [
|
|
55
75
|
// "affiliation",
|
|
56
76
|
// // "confirmed_email",
|
|
57
77
|
// "connection_status",
|
|
@@ -80,40 +100,41 @@ const x = new Client({ bearerToken: "AAAAAAAAAAAAAAAAAAAAAKoQ%2BQEAAAAAaej7PP534
|
|
|
80
100
|
// "withheld"
|
|
81
101
|
// ] })
|
|
82
102
|
// console.log(JSON.stringify(user, null, 4))
|
|
83
|
-
const tweets = await x.users.getPosts("
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
// const tweets = await x.users.getPosts(user.data?.id || "", { tweetFields : [
|
|
104
|
+
// "article",
|
|
105
|
+
// "attachments",
|
|
106
|
+
// "author_id",
|
|
107
|
+
// "card_uri",
|
|
108
|
+
// "community_id",
|
|
109
|
+
// "context_annotations",
|
|
110
|
+
// "conversation_id",
|
|
111
|
+
// "created_at",
|
|
112
|
+
// "display_text_range",
|
|
113
|
+
// "edit_controls",
|
|
114
|
+
// "edit_history_tweet_ids",
|
|
115
|
+
// "entities",
|
|
116
|
+
// "geo",
|
|
117
|
+
// "id",
|
|
118
|
+
// "in_reply_to_user_id",
|
|
119
|
+
// "lang",
|
|
120
|
+
// "matched_media_notes",
|
|
121
|
+
// "media_metadata",
|
|
122
|
+
// "note_request_suggestions",
|
|
123
|
+
// "note_tweet",
|
|
124
|
+
// "paid_partnership",
|
|
125
|
+
// "possibly_sensitive",
|
|
126
|
+
// "referenced_tweets",
|
|
127
|
+
// "reply_settings",
|
|
128
|
+
// "scopes",
|
|
129
|
+
// "source",
|
|
130
|
+
// "suggested_source_links",
|
|
131
|
+
// "suggested_source_links_with_counts",
|
|
132
|
+
// "text",
|
|
133
|
+
// "withheld"
|
|
134
|
+
// ]})
|
|
135
|
+
// console.log(tweets)
|
|
136
|
+
// for (const tweet of tweets.data || []) {
|
|
137
|
+
// console.log(JSON.stringify(tweet, undefined, 4))
|
|
138
|
+
// }
|
|
118
139
|
// const tweet = await x.posts.getReposts("2068675973722128815")
|
|
119
140
|
// console.log(tweets)
|
package/f.txt
ADDED
|
Binary file
|
package/package.json
CHANGED
package/src/UtilsTwitter.ts
CHANGED
|
@@ -8,6 +8,39 @@ export class UtilsTwitter {
|
|
|
8
8
|
this.twitter = new Client({ bearerToken : twitter_api_key })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
async get_user(user_id : string) : Promise<any> {
|
|
12
|
+
const result = await this.twitter.users.getById(user_id, { userFields : [
|
|
13
|
+
"affiliation",
|
|
14
|
+
// "confirmed_email",
|
|
15
|
+
"connection_status",
|
|
16
|
+
"created_at",
|
|
17
|
+
"description",
|
|
18
|
+
"entities",
|
|
19
|
+
"id",
|
|
20
|
+
"is_identity_verified",
|
|
21
|
+
"location",
|
|
22
|
+
"most_recent_tweet_id",
|
|
23
|
+
"name",
|
|
24
|
+
"parody",
|
|
25
|
+
"pinned_tweet_id",
|
|
26
|
+
"profile_banner_url",
|
|
27
|
+
"profile_image_url",
|
|
28
|
+
"protected",
|
|
29
|
+
// "public_metrics",
|
|
30
|
+
// "receives_your_dm",
|
|
31
|
+
"subscription",
|
|
32
|
+
"subscription_type",
|
|
33
|
+
"url",
|
|
34
|
+
"username",
|
|
35
|
+
"verified",
|
|
36
|
+
"verified_followers_count",
|
|
37
|
+
"verified_type",
|
|
38
|
+
"withheld"
|
|
39
|
+
] })
|
|
40
|
+
.then(response => response.data)
|
|
41
|
+
return result
|
|
42
|
+
}
|
|
43
|
+
|
|
11
44
|
async get_user_by_username(username : string) : Promise<any> {
|
|
12
45
|
const result = await this.twitter.users.getByUsername(username, { userFields : [
|
|
13
46
|
"affiliation",
|
|
@@ -42,7 +75,7 @@ export class UtilsTwitter {
|
|
|
42
75
|
}
|
|
43
76
|
|
|
44
77
|
async get_tweets(user_id : string) : Promise<any> {
|
|
45
|
-
const
|
|
78
|
+
const response = await this.twitter.users.getPosts(user_id, { tweetFields : [
|
|
46
79
|
"article",
|
|
47
80
|
"attachments",
|
|
48
81
|
"author_id",
|
|
@@ -74,7 +107,7 @@ export class UtilsTwitter {
|
|
|
74
107
|
"text",
|
|
75
108
|
"withheld"
|
|
76
109
|
]})
|
|
77
|
-
|
|
78
|
-
return
|
|
110
|
+
console.log("RESPONSE", response)
|
|
111
|
+
return response.data
|
|
79
112
|
}
|
|
80
113
|
}
|
package/src/UtilsXAI.ts
CHANGED
|
@@ -46,6 +46,57 @@ export class UtilsXAI {
|
|
|
46
46
|
this.xai_api_key = xai_api_key
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
async grok_simple_query(
|
|
50
|
+
model_id : string,
|
|
51
|
+
prompt : string,
|
|
52
|
+
options : {
|
|
53
|
+
max_tokens? : number,
|
|
54
|
+
print_usage? : boolean,
|
|
55
|
+
json_format? : Record<string, any>,
|
|
56
|
+
web? : boolean
|
|
57
|
+
} = {}
|
|
58
|
+
) : Promise<string | undefined> {
|
|
59
|
+
const response = await fetch("https://api.x.ai/v1/responses", {
|
|
60
|
+
method: "POST",
|
|
61
|
+
body : JSON.stringify({
|
|
62
|
+
model: model_id,
|
|
63
|
+
input: prompt,
|
|
64
|
+
tools : [
|
|
65
|
+
{
|
|
66
|
+
type : "x_search"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
temperature : 0,
|
|
70
|
+
max_output_tokens : options.max_tokens || 1000,
|
|
71
|
+
reasoning : {
|
|
72
|
+
effort : "low"
|
|
73
|
+
},
|
|
74
|
+
text : options.json_format !== undefined ? {
|
|
75
|
+
format : {
|
|
76
|
+
type : "json_schema",
|
|
77
|
+
name : "response",
|
|
78
|
+
strict : true,
|
|
79
|
+
schema : options.json_format
|
|
80
|
+
}
|
|
81
|
+
} : undefined
|
|
82
|
+
|
|
83
|
+
}),
|
|
84
|
+
headers: {
|
|
85
|
+
"Accept" : "application/json",
|
|
86
|
+
"Content-type" : "application/json",
|
|
87
|
+
"Authorization" : "Bearer " + this.xai_api_key
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
const output = await response.json()
|
|
91
|
+
if (options.print_usage !== undefined && options.print_usage) {
|
|
92
|
+
console.log(output.usage)
|
|
93
|
+
}
|
|
94
|
+
const content = output.output.at(-1).content
|
|
95
|
+
const grok_message = content[0]
|
|
96
|
+
const text = grok_message.text
|
|
97
|
+
return text
|
|
98
|
+
}
|
|
99
|
+
|
|
49
100
|
async grok_query(model : string, prompt : string, conversation_history : GrokMessage[] = [], options? : { require_sources : boolean }) : Promise<GrokResponse | undefined> {
|
|
50
101
|
const require_sources = options !== undefined ? options.require_sources : false
|
|
51
102
|
if (this.xai_api_key === undefined) {
|
package/src/f.ts
CHANGED
|
@@ -1,28 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { SecretsManager } from "@aws-sdk/client-secrets-manager"
|
|
2
|
+
import { TriangleUtils } from "."
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
console.log("Starting triangle-utils!")
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const secret_name = "elections_config"
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const secrets_manager = new SecretsManager({ region: "us-east-1" })
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const response = await secrets_manager.getSecretValue({
|
|
11
|
+
SecretId: secret_name
|
|
12
|
+
})
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const api_keys = JSON.parse(response?.SecretString || "")
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// console.log(config)
|
|
16
|
+
const config = {
|
|
17
|
+
google_email : "louishou@triangleanalytics.com",
|
|
18
|
+
alerts_email : "alerts@triangleanalytics.com",
|
|
19
|
+
region : "us-east-1",
|
|
20
|
+
...api_keys
|
|
21
|
+
}
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
console.log(config)
|
|
24
|
+
|
|
25
|
+
const utils = new TriangleUtils(config)
|
|
26
|
+
|
|
27
|
+
const text = await utils.xai.grok_simple_query("grok-4.3", "Find the X username corresponding to the candidate of the committee \"Darializa for Congress\"", {
|
|
28
|
+
print_usage : true,
|
|
29
|
+
json_format : {
|
|
30
|
+
type : "object",
|
|
31
|
+
properties : {
|
|
32
|
+
username : {
|
|
33
|
+
type: "string"
|
|
34
|
+
},
|
|
35
|
+
explanation : {
|
|
36
|
+
type: "string"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
required : [
|
|
40
|
+
"username",
|
|
41
|
+
"explanation"
|
|
42
|
+
],
|
|
43
|
+
additionalProperties : false
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
console.log(text)
|
|
26
47
|
|
|
27
48
|
// const foods = await utils.dynamodb.query("triage_docket_documents:register_document_id", { register_document_id : "E6-17065" })
|
|
28
49
|
|
|
@@ -68,12 +89,12 @@
|
|
|
68
89
|
|
|
69
90
|
// console.log(output)
|
|
70
91
|
|
|
71
|
-
import { Client } from "@xdevplatform/xdk"
|
|
92
|
+
// import { Client } from "@xdevplatform/xdk"
|
|
72
93
|
|
|
73
|
-
const x = new Client({ bearerToken : "AAAAAAAAAAAAAAAAAAAAAKoQ%2BQEAAAAAaej7PP534%2Fd9dKmieHRY6vQkv2s%3DyY2VerXmrA7w794ACFr9ALvoaJfuAHSlWwZdiDeVaOVpA6HCub" })
|
|
94
|
+
// const x = new Client({ bearerToken : "AAAAAAAAAAAAAAAAAAAAAKoQ%2BQEAAAAAaej7PP534%2Fd9dKmieHRY6vQkv2s%3DyY2VerXmrA7w794ACFr9ALvoaJfuAHSlWwZdiDeVaOVpA6HCub" })
|
|
74
95
|
|
|
75
96
|
|
|
76
|
-
// const user = await x.users.getByUsername("
|
|
97
|
+
// const user = await x.users.getByUsername("umichvoter", { userFields : [
|
|
77
98
|
// "affiliation",
|
|
78
99
|
// // "confirmed_email",
|
|
79
100
|
// "connection_status",
|
|
@@ -104,42 +125,44 @@ const x = new Client({ bearerToken : "AAAAAAAAAAAAAAAAAAAAAKoQ%2BQEAAAAAaej7PP53
|
|
|
104
125
|
|
|
105
126
|
// console.log(JSON.stringify(user, null, 4))
|
|
106
127
|
|
|
107
|
-
const tweets = await x.users.getPosts("
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
]})
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
128
|
+
// const tweets = await x.users.getPosts(user.data?.id || "", { tweetFields : [
|
|
129
|
+
// "article",
|
|
130
|
+
// "attachments",
|
|
131
|
+
// "author_id",
|
|
132
|
+
// "card_uri",
|
|
133
|
+
// "community_id",
|
|
134
|
+
// "context_annotations",
|
|
135
|
+
// "conversation_id",
|
|
136
|
+
// "created_at",
|
|
137
|
+
// "display_text_range",
|
|
138
|
+
// "edit_controls",
|
|
139
|
+
// "edit_history_tweet_ids",
|
|
140
|
+
// "entities",
|
|
141
|
+
// "geo",
|
|
142
|
+
// "id",
|
|
143
|
+
// "in_reply_to_user_id",
|
|
144
|
+
// "lang",
|
|
145
|
+
// "matched_media_notes",
|
|
146
|
+
// "media_metadata",
|
|
147
|
+
// "note_request_suggestions",
|
|
148
|
+
// "note_tweet",
|
|
149
|
+
// "paid_partnership",
|
|
150
|
+
// "possibly_sensitive",
|
|
151
|
+
// "referenced_tweets",
|
|
152
|
+
// "reply_settings",
|
|
153
|
+
// "scopes",
|
|
154
|
+
// "source",
|
|
155
|
+
// "suggested_source_links",
|
|
156
|
+
// "suggested_source_links_with_counts",
|
|
157
|
+
// "text",
|
|
158
|
+
// "withheld"
|
|
159
|
+
// ]})
|
|
160
|
+
|
|
161
|
+
// console.log(tweets)
|
|
162
|
+
|
|
163
|
+
// for (const tweet of tweets.data || []) {
|
|
164
|
+
// console.log(JSON.stringify(tweet, undefined, 4))
|
|
165
|
+
// }
|
|
143
166
|
|
|
144
167
|
// const tweet = await x.posts.getReposts("2068675973722128815")
|
|
145
168
|
|