@pipedream/twitter 0.3.11 → 1.0.0
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 +20 -71
- package/dist/actions/add-user-to-list/add-user-to-list.d.ts +380 -0
- package/dist/actions/add-user-to-list/add-user-to-list.mjs +42 -0
- package/dist/actions/create-tweet/create-tweet.d.ts +163 -0
- package/dist/actions/create-tweet/create-tweet.mjs +78 -0
- package/dist/actions/delete-tweet/delete-tweet.d.ts +252 -0
- package/dist/actions/delete-tweet/delete-tweet.mjs +28 -0
- package/dist/actions/follow-user/follow-user.d.ts +255 -0
- package/dist/actions/follow-user/follow-user.mjs +37 -0
- package/dist/actions/get-tweet/get-tweet.d.ts +1006 -0
- package/dist/actions/get-tweet/get-tweet.mjs +35 -0
- package/dist/actions/get-user/get-user.d.ts +634 -0
- package/dist/actions/get-user/get-user.mjs +37 -0
- package/dist/actions/like-tweet/like-tweet.d.ts +252 -0
- package/dist/actions/like-tweet/like-tweet.mjs +30 -0
- package/dist/actions/list-favorites/list-favorites.d.ts +1138 -0
- package/dist/actions/list-favorites/list-favorites.mjs +52 -0
- package/dist/actions/list-followers/list-followers.d.ts +765 -0
- package/dist/actions/list-followers/list-followers.mjs +52 -0
- package/dist/actions/list-lists/list-lists.d.ts +762 -0
- package/dist/actions/list-lists/list-lists.mjs +52 -0
- package/dist/actions/list-mentions/list-mentions.d.ts +1136 -0
- package/dist/actions/list-mentions/list-mentions.mjs +52 -0
- package/dist/actions/list-user-tweets/list-user-tweets.d.ts +1138 -0
- package/dist/actions/list-user-tweets/list-user-tweets.mjs +52 -0
- package/dist/actions/retweet/retweet.d.ts +252 -0
- package/dist/actions/retweet/retweet.mjs +31 -0
- package/dist/actions/simple-search/simple-search.d.ts +1137 -0
- package/dist/actions/simple-search/simple-search.mjs +51 -0
- package/dist/actions/simple-search-in-list/simple-search-in-list.d.ts +1142 -0
- package/dist/actions/simple-search-in-list/simple-search-in-list.mjs +60 -0
- package/dist/actions/unfollow-user/unfollow-user.d.ts +255 -0
- package/dist/actions/unfollow-user/unfollow-user.mjs +33 -0
- package/dist/actions/unlike-tweet/unlike-tweet.d.ts +252 -0
- package/dist/actions/unlike-tweet/unlike-tweet.mjs +28 -0
- package/dist/app/twitter.app.d.ts +127 -0
- package/dist/app/twitter.app.mjs +341 -0
- package/dist/common/dataFields.d.ts +6 -0
- package/dist/common/dataFields.mjs +80 -0
- package/dist/common/expansions.d.ts +3 -0
- package/dist/common/expansions.mjs +17 -0
- package/dist/common/methods.d.ts +20 -0
- package/dist/common/methods.mjs +48 -0
- package/dist/common/propGroups.d.ts +1509 -0
- package/dist/common/propGroups.mjs +82 -0
- package/dist/common/types/fields.d.ts +18 -0
- package/dist/common/types/fields.mjs +1 -0
- package/dist/common/types/requestParams.d.ts +103 -0
- package/dist/common/types/requestParams.mjs +1 -0
- package/dist/common/types/responseSchemas.d.ts +42 -0
- package/dist/common/types/responseSchemas.mjs +1 -0
- package/dist/sources/common/base.d.ts +149 -0
- package/dist/sources/common/base.mjs +62 -0
- package/dist/sources/common/cacheUserId.d.ts +7 -0
- package/dist/sources/common/cacheUserId.mjs +18 -0
- package/dist/sources/common/getItemSummary.d.ts +4 -0
- package/dist/sources/common/getItemSummary.mjs +12 -0
- package/dist/sources/new-follower-of-user/new-follower-of-user.d.ts +650 -0
- package/dist/sources/new-follower-of-user/new-follower-of-user.mjs +49 -0
- package/dist/sources/new-list-followed/new-list-followed.d.ts +649 -0
- package/dist/sources/new-list-followed/new-list-followed.mjs +50 -0
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.d.ts +1021 -0
- package/dist/sources/new-tweet-in-list/new-tweet-in-list.mjs +46 -0
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.d.ts +1023 -0
- package/dist/sources/new-tweet-liked-by-user/new-tweet-liked-by-user.mjs +49 -0
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.d.ts +1023 -0
- package/dist/sources/new-tweet-posted-by-user/new-tweet-posted-by-user.mjs +49 -0
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.d.ts +1021 -0
- package/dist/sources/new-tweet-posted-matching-query/new-tweet-posted-matching-query.mjs +51 -0
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.d.ts +273 -0
- package/dist/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +75 -0
- package/dist/sources/new-user-followed/new-user-followed.d.ts +649 -0
- package/dist/sources/new-user-followed/new-user-followed.mjs +50 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +10 -14
- package/actions/add-user-to-list/add-user-to-list.mjs +0 -62
- package/actions/advanced-search/advanced-search.mjs +0 -113
- package/actions/common.mjs +0 -29
- package/actions/create-tweet/create-tweet.mjs +0 -146
- package/actions/delete-tweet/delete-tweet.mjs +0 -42
- package/actions/follow-user/follow-user.mjs +0 -48
- package/actions/get-tweet/get-tweet.mjs +0 -42
- package/actions/get-user/get-user.mjs +0 -50
- package/actions/like-tweet/like-tweet.mjs +0 -42
- package/actions/list-favorites/list-favorites.mjs +0 -63
- package/actions/list-followers/list-followers.mjs +0 -67
- package/actions/list-lists/list-lists.mjs +0 -69
- package/actions/list-mentions/list-mentions.mjs +0 -55
- package/actions/list-pending-followers/list-pending-followers.mjs +0 -32
- package/actions/list-retweets/list-retweets.mjs +0 -54
- package/actions/list-user-tweets/list-user-tweets.mjs +0 -80
- package/actions/retweet/retweet.mjs +0 -27
- package/actions/simple-search/simple-search.mjs +0 -62
- package/actions/simple-search-in-list/simple-search-in-list.mjs +0 -48
- package/actions/unfollow-user/unfollow-user.mjs +0 -48
- package/actions/unlike-tweet/unlike-tweet.mjs +0 -40
- package/actions/upload-media/upload-media.mjs +0 -122
- package/old.md +0 -169
- package/sources/common/followed.mjs +0 -38
- package/sources/common/followers.mjs +0 -159
- package/sources/common/tweets.mjs +0 -155
- package/sources/language-codes.mjs +0 -742
- package/sources/my-liked-tweets/my-liked-tweets.mjs +0 -30
- package/sources/my-tweets/my-tweets.mjs +0 -48
- package/sources/new-follower-of-me/new-follower-of-me.mjs +0 -69
- package/sources/new-follower-of-user/new-follower-of-user.mjs +0 -25
- package/sources/new-list-followed/new-list-followed.mjs +0 -24
- package/sources/new-trends-by-geo/new-trends-by-geo.mjs +0 -40
- package/sources/new-tweet-in-list/new-tweet-in-list.mjs +0 -49
- package/sources/new-unfollower-of-me/new-unfollower-of-me.mjs +0 -16
- package/sources/new-unfollower-of-user/new-unfollower-of-user.mjs +0 -25
- package/sources/new-user-followed/new-user-followed.mjs +0 -25
- package/sources/search-mentions/search-mentions.mjs +0 -144
- package/sources/tweets-liked-by-user/tweets-liked-by-user.mjs +0 -38
- package/sources/user-tweets/user-tweets.mjs +0 -49
- package/sources/watch-retweets-of-me/watch-retweets-of-me.mjs +0 -36
- package/sources/watch-retweets-of-my-tweet/watch-retweets-of-my-tweet.mjs +0 -44
- package/sources/watch-retweets-of-user-tweet/watch-retweets-of-user-tweet.mjs +0 -34
- package/twitter.app.mjs +0 -1161
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import twitter from "../../twitter.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "twitter-get-user",
|
|
5
|
-
name: "Get User",
|
|
6
|
-
description: "Return information about the user specified by ID or screen name parameter. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup)",
|
|
7
|
-
version: "0.0.2",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
twitter,
|
|
11
|
-
userId: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
twitter,
|
|
14
|
-
"userId",
|
|
15
|
-
],
|
|
16
|
-
optional: true,
|
|
17
|
-
},
|
|
18
|
-
screenName: {
|
|
19
|
-
propDefinition: [
|
|
20
|
-
twitter,
|
|
21
|
-
"screenName",
|
|
22
|
-
],
|
|
23
|
-
optional: true,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
async run({ $ }) {
|
|
27
|
-
const {
|
|
28
|
-
userId,
|
|
29
|
-
screenName,
|
|
30
|
-
} = this;
|
|
31
|
-
|
|
32
|
-
if (!userId && !screenName) {
|
|
33
|
-
throw new Error("This action requires either User ID or Screen Name. Please enter one or the other above.");
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const userIdArray = [
|
|
37
|
-
userId,
|
|
38
|
-
];
|
|
39
|
-
const screenNameArray = [
|
|
40
|
-
screenName,
|
|
41
|
-
];
|
|
42
|
-
const res = await this.twitter.lookupUsers({
|
|
43
|
-
$,
|
|
44
|
-
userIdArray,
|
|
45
|
-
screenNameArray,
|
|
46
|
-
});
|
|
47
|
-
$.export("$summary", "Successfully retrieved user");
|
|
48
|
-
return res;
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import twitter from "../../twitter.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "twitter-like-tweet",
|
|
5
|
-
name: "Like Tweet",
|
|
6
|
-
description: "Like the tweet specified specified in the ID parameter. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-create)",
|
|
7
|
-
version: "0.0.2",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
twitter,
|
|
11
|
-
id: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
twitter,
|
|
14
|
-
"tweetID",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
includeEntities: {
|
|
18
|
-
propDefinition: [
|
|
19
|
-
twitter,
|
|
20
|
-
"includeEntities",
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
async run({ $ }) {
|
|
25
|
-
const {
|
|
26
|
-
id,
|
|
27
|
-
includeEntities,
|
|
28
|
-
} = this;
|
|
29
|
-
|
|
30
|
-
const params = {
|
|
31
|
-
id,
|
|
32
|
-
includeEntities,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const res = await this.twitter.likeTweet({
|
|
36
|
-
$,
|
|
37
|
-
...params,
|
|
38
|
-
});
|
|
39
|
-
$.export("$summary", "Successfully liked tweet");
|
|
40
|
-
return res;
|
|
41
|
-
},
|
|
42
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import common from "../common.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "twitter-list-favorites",
|
|
6
|
-
name: "List Favorites",
|
|
7
|
-
description: "Return the most recent tweets liked by you or the specified user. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
...common.props,
|
|
12
|
-
screenName: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.twitter,
|
|
15
|
-
"screenName",
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
count: {
|
|
19
|
-
propDefinition: [
|
|
20
|
-
common.props.twitter,
|
|
21
|
-
"count",
|
|
22
|
-
],
|
|
23
|
-
description: "Specifies the number of records to retrieve. Must be less than or equal to `200`; defaults to `20`.",
|
|
24
|
-
optional: true,
|
|
25
|
-
default: 20,
|
|
26
|
-
},
|
|
27
|
-
maxRequests: {
|
|
28
|
-
propDefinition: [
|
|
29
|
-
common.props.twitter,
|
|
30
|
-
"maxRequests",
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
includeEntities: {
|
|
34
|
-
propDefinition: [
|
|
35
|
-
common.props.twitter,
|
|
36
|
-
"includeEntities",
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
async run({ $ }) {
|
|
41
|
-
const {
|
|
42
|
-
screenName,
|
|
43
|
-
count,
|
|
44
|
-
maxRequests,
|
|
45
|
-
includeEntities,
|
|
46
|
-
} = this;
|
|
47
|
-
|
|
48
|
-
const params = {
|
|
49
|
-
$,
|
|
50
|
-
screenName,
|
|
51
|
-
count,
|
|
52
|
-
maxRequests,
|
|
53
|
-
include_entities: includeEntities,
|
|
54
|
-
};
|
|
55
|
-
const tweets = await this.paginate(this.twitter.getLikedTweets.bind(this), params);
|
|
56
|
-
const results = [];
|
|
57
|
-
for await (const tweet of tweets) {
|
|
58
|
-
results.push(tweet);
|
|
59
|
-
}
|
|
60
|
-
$.export("$summary", "Successfully retrieved favorites");
|
|
61
|
-
return results;
|
|
62
|
-
},
|
|
63
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import common from "../common.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "twitter-list-followers",
|
|
6
|
-
name: "List Followers",
|
|
7
|
-
description: "Return a collection of user objects for users following the specified user. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-list)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
...common.props,
|
|
12
|
-
userId: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.twitter,
|
|
15
|
-
"userId",
|
|
16
|
-
],
|
|
17
|
-
optional: true,
|
|
18
|
-
},
|
|
19
|
-
screenName: {
|
|
20
|
-
propDefinition: [
|
|
21
|
-
common.props.twitter,
|
|
22
|
-
"screenName",
|
|
23
|
-
],
|
|
24
|
-
optional: true,
|
|
25
|
-
},
|
|
26
|
-
maxRequests: {
|
|
27
|
-
propDefinition: [
|
|
28
|
-
common.props.twitter,
|
|
29
|
-
"maxRequests",
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
includeUserEntities: {
|
|
33
|
-
propDefinition: [
|
|
34
|
-
common.props.twitter,
|
|
35
|
-
"includeUserEntities",
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
async run({ $ }) {
|
|
40
|
-
const {
|
|
41
|
-
userId,
|
|
42
|
-
screenName,
|
|
43
|
-
maxRequests,
|
|
44
|
-
includeUserEntities,
|
|
45
|
-
} = this;
|
|
46
|
-
|
|
47
|
-
if (!userId && !screenName) {
|
|
48
|
-
throw new Error("This action requires either User ID or Screen Name. Please enter one or the other above.");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const params = {
|
|
52
|
-
$,
|
|
53
|
-
userId,
|
|
54
|
-
screenName,
|
|
55
|
-
maxRequests,
|
|
56
|
-
includeUserEntities,
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const followers = await this.paginate(this.twitter.getFollowers.bind(this), params, "users");
|
|
60
|
-
const results = [];
|
|
61
|
-
for await (const follower of followers) {
|
|
62
|
-
results.push(follower);
|
|
63
|
-
}
|
|
64
|
-
$.export("$summary", "Successfully retrieved followers");
|
|
65
|
-
return results;
|
|
66
|
-
},
|
|
67
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import common from "../common.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "twitter-list-lists",
|
|
6
|
-
name: "List Lists",
|
|
7
|
-
description: "Return all lists the authenticated or specified user subscribes to including their own. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
...common.props,
|
|
12
|
-
userId: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.twitter,
|
|
15
|
-
"userId",
|
|
16
|
-
],
|
|
17
|
-
optional: true,
|
|
18
|
-
},
|
|
19
|
-
screenName: {
|
|
20
|
-
propDefinition: [
|
|
21
|
-
common.props.twitter,
|
|
22
|
-
"screenName",
|
|
23
|
-
],
|
|
24
|
-
optional: true,
|
|
25
|
-
},
|
|
26
|
-
reverse: {
|
|
27
|
-
type: "boolean",
|
|
28
|
-
label: "Reverse",
|
|
29
|
-
description: "Set this to `true` if you would like owned lists to be returned first.",
|
|
30
|
-
optional: true,
|
|
31
|
-
default: false,
|
|
32
|
-
},
|
|
33
|
-
maxRequests: {
|
|
34
|
-
propDefinition: [
|
|
35
|
-
common.props.twitter,
|
|
36
|
-
"maxRequests",
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
async run({ $ }) {
|
|
41
|
-
const {
|
|
42
|
-
userId,
|
|
43
|
-
screenName,
|
|
44
|
-
reverse,
|
|
45
|
-
maxRequests,
|
|
46
|
-
} = this;
|
|
47
|
-
|
|
48
|
-
if (!userId && !screenName) {
|
|
49
|
-
throw new Error("This action requires either User ID or Screen Name. Please enter one or the other above.");
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const params = {
|
|
53
|
-
$,
|
|
54
|
-
maxRequests,
|
|
55
|
-
params: {
|
|
56
|
-
user_id: userId,
|
|
57
|
-
screen_name: screenName,
|
|
58
|
-
reverse,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
const lists = await this.paginate(this.twitter.getLists.bind(this), params);
|
|
62
|
-
const results = [];
|
|
63
|
-
for await (const list of lists) {
|
|
64
|
-
results.push(list);
|
|
65
|
-
}
|
|
66
|
-
$.export("$summary", "Successfully retrieved lists");
|
|
67
|
-
return results;
|
|
68
|
-
},
|
|
69
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import common from "../common.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "twitter-list-mentions",
|
|
6
|
-
name: "List Mentions",
|
|
7
|
-
description: "Return the 20 most recent mentions for the authenticated user. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
...common.props,
|
|
12
|
-
count: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.twitter,
|
|
15
|
-
"count",
|
|
16
|
-
],
|
|
17
|
-
description: "Specifies the number of records to retrieve. Must be less than or equal to `200`; defaults to `20`.",
|
|
18
|
-
optional: true,
|
|
19
|
-
default: 20,
|
|
20
|
-
},
|
|
21
|
-
maxRequests: {
|
|
22
|
-
propDefinition: [
|
|
23
|
-
common.props.twitter,
|
|
24
|
-
"maxRequests",
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
includeEntities: {
|
|
28
|
-
propDefinition: [
|
|
29
|
-
common.props.twitter,
|
|
30
|
-
"includeEntities",
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
async run({ $ }) {
|
|
35
|
-
const {
|
|
36
|
-
count,
|
|
37
|
-
maxRequests,
|
|
38
|
-
includeEntities,
|
|
39
|
-
} = this;
|
|
40
|
-
|
|
41
|
-
const params = {
|
|
42
|
-
$,
|
|
43
|
-
count,
|
|
44
|
-
maxRequests,
|
|
45
|
-
includeEntities,
|
|
46
|
-
};
|
|
47
|
-
const tweets = await this.paginate(this.twitter.getMentionsTimeline.bind(this), params);
|
|
48
|
-
const results = [];
|
|
49
|
-
for await (const tweet of tweets) {
|
|
50
|
-
results.push(tweet);
|
|
51
|
-
}
|
|
52
|
-
$.export("$summary", "Sucessfully retrieved mentions");
|
|
53
|
-
return results;
|
|
54
|
-
},
|
|
55
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import common from "../common.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "twitter-list-pending-followers",
|
|
6
|
-
name: "List Pending Followers",
|
|
7
|
-
description: "Return a collection of numeric IDs for every user who has a pending request to follow the authenticated user. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
...common.props,
|
|
12
|
-
maxRequests: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.twitter,
|
|
15
|
-
"maxRequests",
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
async run({ $ }) {
|
|
20
|
-
const { maxRequests } = this;
|
|
21
|
-
const followers = await this.paginate(this.twitter.getPendingFollowers.bind(this), {
|
|
22
|
-
$,
|
|
23
|
-
maxRequests,
|
|
24
|
-
}, "ids");
|
|
25
|
-
const results = [];
|
|
26
|
-
for await (const follower of followers) {
|
|
27
|
-
results.push(follower);
|
|
28
|
-
}
|
|
29
|
-
$.export("$summary", "Successfully retrieved pending followers");
|
|
30
|
-
return results;
|
|
31
|
-
},
|
|
32
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import common from "../common.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "twitter-list-retweets",
|
|
6
|
-
name: "List Retweets",
|
|
7
|
-
description: "Return a collection of recent retweets of a tweet by ID parameter. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-retweets-id)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
...common.props,
|
|
12
|
-
id: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.twitter,
|
|
15
|
-
"tweetID",
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
count: {
|
|
19
|
-
propDefinition: [
|
|
20
|
-
common.props.twitter,
|
|
21
|
-
"count",
|
|
22
|
-
],
|
|
23
|
-
optional: true,
|
|
24
|
-
default: 20,
|
|
25
|
-
},
|
|
26
|
-
maxRequests: {
|
|
27
|
-
propDefinition: [
|
|
28
|
-
common.props.twitter,
|
|
29
|
-
"maxRequests",
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
async run({ $ }) {
|
|
34
|
-
const {
|
|
35
|
-
id,
|
|
36
|
-
count,
|
|
37
|
-
maxRequests,
|
|
38
|
-
} = this;
|
|
39
|
-
|
|
40
|
-
const params = {
|
|
41
|
-
$,
|
|
42
|
-
id,
|
|
43
|
-
count,
|
|
44
|
-
maxRequests,
|
|
45
|
-
};
|
|
46
|
-
const tweets = await this.paginate(this.twitter.getRetweets.bind(this), params);
|
|
47
|
-
const results = [];
|
|
48
|
-
for await (const tweet of tweets) {
|
|
49
|
-
results.push(tweet);
|
|
50
|
-
}
|
|
51
|
-
$.export("$summary", "Successfully retrieved retweets");
|
|
52
|
-
return results;
|
|
53
|
-
},
|
|
54
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import common from "../common.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...common,
|
|
5
|
-
key: "twitter-list-user-tweets",
|
|
6
|
-
name: "List User Tweets",
|
|
7
|
-
description: "Return a collection of the most recent tweets posted by a user. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
...common.props,
|
|
12
|
-
screenName: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
common.props.twitter,
|
|
15
|
-
"screenName",
|
|
16
|
-
],
|
|
17
|
-
optional: true,
|
|
18
|
-
},
|
|
19
|
-
count: {
|
|
20
|
-
propDefinition: [
|
|
21
|
-
common.props.twitter,
|
|
22
|
-
"count",
|
|
23
|
-
],
|
|
24
|
-
optional: true,
|
|
25
|
-
default: 20,
|
|
26
|
-
},
|
|
27
|
-
maxRequests: {
|
|
28
|
-
propDefinition: [
|
|
29
|
-
common.props.twitter,
|
|
30
|
-
"maxRequests",
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
includeRetweets: {
|
|
34
|
-
propDefinition: [
|
|
35
|
-
common.props.twitter,
|
|
36
|
-
"includeRetweets",
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
includeReplies: {
|
|
40
|
-
propDefinition: [
|
|
41
|
-
common.props.twitter,
|
|
42
|
-
"includeReplies",
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
methods: {
|
|
47
|
-
...common.methods,
|
|
48
|
-
shouldExcludeReplies(includeReplies) {
|
|
49
|
-
return includeReplies === "exclude";
|
|
50
|
-
},
|
|
51
|
-
shouldIncludeRetweets(includeRetweets) {
|
|
52
|
-
return includeRetweets !== "exclude";
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
async run({ $ }) {
|
|
56
|
-
const {
|
|
57
|
-
screenName,
|
|
58
|
-
count,
|
|
59
|
-
maxRequests,
|
|
60
|
-
includeRetweets,
|
|
61
|
-
includeReplies,
|
|
62
|
-
} = this;
|
|
63
|
-
|
|
64
|
-
const params = {
|
|
65
|
-
$,
|
|
66
|
-
screenName,
|
|
67
|
-
count,
|
|
68
|
-
maxRequests,
|
|
69
|
-
exclude_replies: this.shouldExcludeReplies(includeReplies),
|
|
70
|
-
include_rts: this.shouldIncludeRetweets(includeRetweets),
|
|
71
|
-
};
|
|
72
|
-
const tweets = await this.paginate(this.twitter.getUserTimeline.bind(this), params);
|
|
73
|
-
const results = [];
|
|
74
|
-
for await (const tweet of tweets) {
|
|
75
|
-
results.push(tweet);
|
|
76
|
-
}
|
|
77
|
-
$.export("$summary", "Successfully retrieved user tweets");
|
|
78
|
-
return results;
|
|
79
|
-
},
|
|
80
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import twitter from "../../twitter.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "twitter-retweet",
|
|
5
|
-
name: "Retweet a tweet",
|
|
6
|
-
description: "Retweets a specific tweet by ID. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-retweet-id)",
|
|
7
|
-
version: "0.0.3",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
twitter,
|
|
11
|
-
tweetID: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
twitter,
|
|
14
|
-
"tweetID",
|
|
15
|
-
],
|
|
16
|
-
description: "The numerical ID of the tweet you'd like to retweet",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
async run({ $ }) {
|
|
20
|
-
const res = await this.twitter.retweet({
|
|
21
|
-
$,
|
|
22
|
-
tweetID: this.tweetID,
|
|
23
|
-
});
|
|
24
|
-
$.export("$summary", "Tweet successfully retweeted");
|
|
25
|
-
return res;
|
|
26
|
-
},
|
|
27
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import twitter from "../../twitter.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "twitter-simple-search",
|
|
5
|
-
name: "Simple Search",
|
|
6
|
-
description: "Return Tweets that matches your search criteria. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/api-reference/get-search-tweets)",
|
|
7
|
-
version: "0.0.8",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
twitter,
|
|
11
|
-
q: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
twitter,
|
|
14
|
-
"q",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
resultType: {
|
|
18
|
-
propDefinition: [
|
|
19
|
-
twitter,
|
|
20
|
-
"resultType",
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
includeRetweets: {
|
|
24
|
-
propDefinition: [
|
|
25
|
-
twitter,
|
|
26
|
-
"includeRetweets",
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
includeReplies: {
|
|
30
|
-
propDefinition: [
|
|
31
|
-
twitter,
|
|
32
|
-
"includeReplies",
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
async run({ $ }) {
|
|
37
|
-
const {
|
|
38
|
-
resultType,
|
|
39
|
-
enrichTweets,
|
|
40
|
-
includeReplies,
|
|
41
|
-
includeRetweets,
|
|
42
|
-
maxRequests,
|
|
43
|
-
count,
|
|
44
|
-
} = this;
|
|
45
|
-
let q = this.q;
|
|
46
|
-
|
|
47
|
-
// run paginated search
|
|
48
|
-
const res = await this.twitter.paginatedSearch({
|
|
49
|
-
$,
|
|
50
|
-
q,
|
|
51
|
-
resultType,
|
|
52
|
-
enrichTweets,
|
|
53
|
-
includeReplies,
|
|
54
|
-
includeRetweets,
|
|
55
|
-
maxRequests,
|
|
56
|
-
count,
|
|
57
|
-
limitFirstPage: false,
|
|
58
|
-
});
|
|
59
|
-
$.export("$summary", "Search completed successfully");
|
|
60
|
-
return res;
|
|
61
|
-
},
|
|
62
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import twitter from "../../twitter.app.mjs";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
key: "twitter-simple-search-in-list",
|
|
5
|
-
name: "Simple Search in List",
|
|
6
|
-
description: "Return Tweets that match your search criteria in a specific list. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses)",
|
|
7
|
-
version: "0.0.2",
|
|
8
|
-
type: "action",
|
|
9
|
-
props: {
|
|
10
|
-
twitter,
|
|
11
|
-
listId: {
|
|
12
|
-
propDefinition: [
|
|
13
|
-
twitter,
|
|
14
|
-
"list",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
query: {
|
|
18
|
-
propDefinition: [
|
|
19
|
-
twitter,
|
|
20
|
-
"q",
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
includeRetweets: {
|
|
24
|
-
propDefinition: [
|
|
25
|
-
twitter,
|
|
26
|
-
"includeRetweets",
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
includeEntities: {
|
|
30
|
-
type: "boolean",
|
|
31
|
-
label: "Entities",
|
|
32
|
-
description: "Include the 'entities' node, which offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags",
|
|
33
|
-
default: false,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
async run({ $ }) {
|
|
37
|
-
let tweets = await this.twitter.getPaginateListTweets({
|
|
38
|
-
listId: this.listId,
|
|
39
|
-
includeEntities: this.includeEntities,
|
|
40
|
-
includeRetweets: this.includeRetweets !== "exclude",
|
|
41
|
-
});
|
|
42
|
-
tweets = tweets.filter((tweet) => tweet?.full_text?.includes(this.query));
|
|
43
|
-
$.export("$summary", `${tweets.length} search ${tweets.length === 1
|
|
44
|
-
? "result has"
|
|
45
|
-
: "results have"} been found.`);
|
|
46
|
-
return tweets;
|
|
47
|
-
},
|
|
48
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import twitter from "../../twitter.app.mjs";
|
|
2
|
-
import { ConfigurationError } from "@pipedream/platform";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
key: "twitter-unfollow-user",
|
|
6
|
-
name: "Unfollow User",
|
|
7
|
-
description: "Unfollow the user specified by ID or screen name parameter. [See the docs here](https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy)",
|
|
8
|
-
version: "0.0.2",
|
|
9
|
-
type: "action",
|
|
10
|
-
props: {
|
|
11
|
-
twitter,
|
|
12
|
-
userId: {
|
|
13
|
-
propDefinition: [
|
|
14
|
-
twitter,
|
|
15
|
-
"userId",
|
|
16
|
-
],
|
|
17
|
-
optional: true,
|
|
18
|
-
},
|
|
19
|
-
screenName: {
|
|
20
|
-
propDefinition: [
|
|
21
|
-
twitter,
|
|
22
|
-
"screenName",
|
|
23
|
-
],
|
|
24
|
-
optional: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
async run({ $ }) {
|
|
28
|
-
const {
|
|
29
|
-
userId,
|
|
30
|
-
screenName,
|
|
31
|
-
} = this;
|
|
32
|
-
|
|
33
|
-
if (!userId && !screenName) {
|
|
34
|
-
throw new ConfigurationError("This action requires either User ID or Screen Name. Please enter one or the other above.");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const params = {
|
|
38
|
-
user_id: userId,
|
|
39
|
-
screen_name: screenName,
|
|
40
|
-
};
|
|
41
|
-
const response = await this.twitter.unfollowUser({
|
|
42
|
-
params,
|
|
43
|
-
$,
|
|
44
|
-
});
|
|
45
|
-
$.export("$summary", "Successfully unfollowed user");
|
|
46
|
-
return response;
|
|
47
|
-
},
|
|
48
|
-
};
|