triangle-utils 1.4.67 → 1.4.69
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 +32 -0
- package/dist/src/UtilsXAI.js +3 -0
- package/package.json +1 -1
- package/src/UtilsTwitter.ts +33 -0
- package/src/UtilsXAI.ts +3 -0
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",
|
package/dist/src/UtilsXAI.js
CHANGED
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",
|