universal-mcp-applications 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl
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.
Potentially problematic release.
This version of universal-mcp-applications might be problematic. Click here for more details.
- universal_mcp/applications/aws_s3/app.py +71 -71
- universal_mcp/applications/calendly/app.py +199 -199
- universal_mcp/applications/canva/app.py +189 -189
- universal_mcp/applications/domain_checker/app.py +31 -24
- universal_mcp/applications/e2b/app.py +6 -7
- universal_mcp/applications/elevenlabs/app.py +24 -20
- universal_mcp/applications/exa/app.py +25 -20
- universal_mcp/applications/falai/app.py +44 -41
- universal_mcp/applications/file_system/app.py +20 -12
- universal_mcp/applications/firecrawl/app.py +46 -47
- universal_mcp/applications/fireflies/app.py +79 -79
- universal_mcp/applications/fpl/app.py +83 -74
- universal_mcp/applications/github/README.md +0 -1028
- universal_mcp/applications/github/app.py +55 -50227
- universal_mcp/applications/google_calendar/app.py +63 -65
- universal_mcp/applications/google_docs/app.py +78 -78
- universal_mcp/applications/google_drive/app.py +361 -440
- universal_mcp/applications/google_gemini/app.py +34 -17
- universal_mcp/applications/google_mail/app.py +117 -117
- universal_mcp/applications/google_searchconsole/app.py +41 -47
- universal_mcp/applications/google_sheet/app.py +157 -164
- universal_mcp/applications/http_tools/app.py +16 -16
- universal_mcp/applications/linkedin/app.py +26 -31
- universal_mcp/applications/ms_teams/app.py +190 -190
- universal_mcp/applications/openai/app.py +55 -56
- universal_mcp/applications/outlook/app.py +71 -71
- universal_mcp/applications/perplexity/app.py +17 -17
- universal_mcp/applications/reddit/app.py +225 -4053
- universal_mcp/applications/replicate/app.py +40 -42
- universal_mcp/applications/resend/app.py +157 -154
- universal_mcp/applications/scraper/app.py +24 -24
- universal_mcp/applications/serpapi/app.py +18 -20
- universal_mcp/applications/sharepoint/app.py +46 -36
- universal_mcp/applications/slack/app.py +66 -66
- universal_mcp/applications/tavily/app.py +7 -7
- universal_mcp/applications/twitter/api_segments/compliance_api.py +17 -20
- universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +35 -40
- universal_mcp/applications/twitter/api_segments/dm_events_api.py +18 -21
- universal_mcp/applications/twitter/api_segments/likes_api.py +19 -22
- universal_mcp/applications/twitter/api_segments/lists_api.py +59 -68
- universal_mcp/applications/twitter/api_segments/spaces_api.py +36 -42
- universal_mcp/applications/twitter/api_segments/trends_api.py +7 -8
- universal_mcp/applications/twitter/api_segments/tweets_api.py +159 -185
- universal_mcp/applications/twitter/api_segments/usage_api.py +5 -6
- universal_mcp/applications/twitter/api_segments/users_api.py +230 -264
- universal_mcp/applications/unipile/app.py +99 -105
- universal_mcp/applications/whatsapp/app.py +86 -82
- universal_mcp/applications/whatsapp_business/app.py +147 -147
- universal_mcp/applications/youtube/app.py +290 -290
- universal_mcp/applications/zenquotes/app.py +6 -6
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/METADATA +2 -2
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/RECORD +54 -54
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/WHEEL +0 -0
- {universal_mcp_applications-0.1.13.dist-info → universal_mcp_applications-0.1.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,25 +7,24 @@ class DmConversationsApi(APISegmentBase):
|
|
|
7
7
|
def __init__(self, main_app_client: Any):
|
|
8
8
|
super().__init__(main_app_client)
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def create_dm_conversation(
|
|
11
11
|
self, conversation_type=None, message=None, participant_ids=None
|
|
12
12
|
) -> dict[str, Any]:
|
|
13
13
|
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Creates a new group Direct Message conversation with specified participants and sends an initial message. This function specifically handles the creation of new multi-participant conversations, distinct from other methods in this class that add messages to existing one-to-one or group DMs.
|
|
15
|
+
|
|
17
16
|
Args:
|
|
18
17
|
conversation_type (string): The conversation type that is being created.
|
|
19
18
|
message (string): message
|
|
20
19
|
participant_ids (array): Participants for the DM Conversation.
|
|
21
|
-
|
|
20
|
+
|
|
22
21
|
Returns:
|
|
23
22
|
dict[str, Any]: The request has succeeded.
|
|
24
|
-
|
|
23
|
+
|
|
25
24
|
Raises:
|
|
26
25
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
27
26
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
28
|
-
|
|
27
|
+
|
|
29
28
|
Tags:
|
|
30
29
|
Direct Messages
|
|
31
30
|
"""
|
|
@@ -49,7 +48,7 @@ class DmConversationsApi(APISegmentBase):
|
|
|
49
48
|
response.raise_for_status()
|
|
50
49
|
return response.json()
|
|
51
50
|
|
|
52
|
-
def
|
|
51
|
+
def get_dm_events_by_participant_id(
|
|
53
52
|
self,
|
|
54
53
|
participant_id,
|
|
55
54
|
max_results=None,
|
|
@@ -62,9 +61,8 @@ class DmConversationsApi(APISegmentBase):
|
|
|
62
61
|
tweet_fields=None,
|
|
63
62
|
) -> dict[str, Any]:
|
|
64
63
|
"""
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
Retrieves direct message events from a conversation identified by a specific participant's ID. Supports pagination and filtering by event type. This method is distinct from `get_dm_conversations_id_dm_events`, which uses a direct conversation ID for retrieval instead of a participant's ID.
|
|
65
|
+
|
|
68
66
|
Args:
|
|
69
67
|
participant_id (string): participant_id
|
|
70
68
|
max_results (integer): The maximum number of direct message events to return in the response, with a default of 100.
|
|
@@ -75,14 +73,14 @@ class DmConversationsApi(APISegmentBase):
|
|
|
75
73
|
media_fields (array): A comma separated list of Media fields to display. Example: "['alt_text', 'duration_ms', 'height', 'media_key', 'non_public_metrics', 'organic_metrics', 'preview_image_url', 'promoted_metrics', 'public_metrics', 'type', 'url', 'variants', 'width']".
|
|
76
74
|
user_fields (array): A comma separated list of User fields to display. Example: "['affiliation', 'connection_status', 'created_at', 'description', 'entities', 'id', 'location', 'most_recent_tweet_id', 'name', 'pinned_tweet_id', 'profile_banner_url', 'profile_image_url', 'protected', 'public_metrics', 'receives_your_dm', 'subscription_type', 'url', 'username', 'verified', 'verified_type', 'withheld']".
|
|
77
75
|
tweet_fields (array): A comma separated list of Tweet fields to display. Example: "['article', 'attachments', 'author_id', 'card_uri', 'context_annotations', 'conversation_id', 'created_at', 'edit_controls', 'edit_history_tweet_ids', 'entities', 'geo', 'id', 'in_reply_to_user_id', 'lang', 'non_public_metrics', 'note_tweet', 'organic_metrics', 'possibly_sensitive', 'promoted_metrics', 'public_metrics', 'referenced_tweets', 'reply_settings', 'scopes', 'source', 'text', 'username', 'withheld']".
|
|
78
|
-
|
|
76
|
+
|
|
79
77
|
Returns:
|
|
80
78
|
dict[str, Any]: The request has succeeded.
|
|
81
|
-
|
|
79
|
+
|
|
82
80
|
Raises:
|
|
83
81
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
84
82
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
85
|
-
|
|
83
|
+
|
|
86
84
|
Tags:
|
|
87
85
|
Direct Messages
|
|
88
86
|
"""
|
|
@@ -107,25 +105,24 @@ class DmConversationsApi(APISegmentBase):
|
|
|
107
105
|
response.raise_for_status()
|
|
108
106
|
return response.json()
|
|
109
107
|
|
|
110
|
-
def
|
|
108
|
+
def send_dm_by_participant_id(
|
|
111
109
|
self, participant_id, attachments=None, text=None
|
|
112
110
|
) -> dict[str, Any]:
|
|
113
111
|
"""
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
Sends a direct message to a user specified by their participant ID. It creates a new one-on-one conversation or appends the message to an existing one. Unlike other functions, this method identifies the conversation using the participant's ID rather than a pre-existing conversation ID.
|
|
113
|
+
|
|
117
114
|
Args:
|
|
118
115
|
participant_id (string): participant_id
|
|
119
116
|
attachments (array): Attachments to a DM Event.
|
|
120
117
|
text (string): Text of the message.
|
|
121
|
-
|
|
118
|
+
|
|
122
119
|
Returns:
|
|
123
120
|
dict[str, Any]: The request has succeeded.
|
|
124
|
-
|
|
121
|
+
|
|
125
122
|
Raises:
|
|
126
123
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
127
124
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
128
|
-
|
|
125
|
+
|
|
129
126
|
Tags:
|
|
130
127
|
Direct Messages
|
|
131
128
|
"""
|
|
@@ -147,25 +144,24 @@ class DmConversationsApi(APISegmentBase):
|
|
|
147
144
|
response.raise_for_status()
|
|
148
145
|
return response.json()
|
|
149
146
|
|
|
150
|
-
def
|
|
147
|
+
def add_message_to_dm_conversation(
|
|
151
148
|
self, dm_conversation_id, attachments=None, text=None
|
|
152
149
|
) -> dict[str, Any]:
|
|
153
150
|
"""
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
Sends a new message with optional text and attachments to an existing Direct Message conversation. The target conversation is specified by its `dm_conversation_id`, distinguishing it from functions that create new conversations or send one-to-one messages using a participant ID.
|
|
152
|
+
|
|
157
153
|
Args:
|
|
158
154
|
dm_conversation_id (string): dm_conversation_id
|
|
159
155
|
attachments (array): Attachments to a DM Event.
|
|
160
156
|
text (string): Text of the message.
|
|
161
|
-
|
|
157
|
+
|
|
162
158
|
Returns:
|
|
163
159
|
dict[str, Any]: The request has succeeded.
|
|
164
|
-
|
|
160
|
+
|
|
165
161
|
Raises:
|
|
166
162
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
167
163
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
168
|
-
|
|
164
|
+
|
|
169
165
|
Tags:
|
|
170
166
|
Direct Messages
|
|
171
167
|
"""
|
|
@@ -187,7 +183,7 @@ class DmConversationsApi(APISegmentBase):
|
|
|
187
183
|
response.raise_for_status()
|
|
188
184
|
return response.json()
|
|
189
185
|
|
|
190
|
-
def
|
|
186
|
+
def get_dm_events_by_conversation_id(
|
|
191
187
|
self,
|
|
192
188
|
id,
|
|
193
189
|
max_results=None,
|
|
@@ -200,9 +196,8 @@ class DmConversationsApi(APISegmentBase):
|
|
|
200
196
|
tweet_fields=None,
|
|
201
197
|
) -> dict[str, Any]:
|
|
202
198
|
"""
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
Retrieves direct message events for a specific conversation using its unique ID. This function, distinct from fetching by participant ID, supports pagination, event type filtering, and data field expansion for detailed results.
|
|
200
|
+
|
|
206
201
|
Args:
|
|
207
202
|
id (string): id
|
|
208
203
|
max_results (integer): Limits the number of DM events returned in the response, with a default value of 100, allowing users to customize the amount of data retrieved.
|
|
@@ -213,14 +208,14 @@ class DmConversationsApi(APISegmentBase):
|
|
|
213
208
|
media_fields (array): A comma separated list of Media fields to display. Example: "['alt_text', 'duration_ms', 'height', 'media_key', 'non_public_metrics', 'organic_metrics', 'preview_image_url', 'promoted_metrics', 'public_metrics', 'type', 'url', 'variants', 'width']".
|
|
214
209
|
user_fields (array): A comma separated list of User fields to display. Example: "['affiliation', 'connection_status', 'created_at', 'description', 'entities', 'id', 'location', 'most_recent_tweet_id', 'name', 'pinned_tweet_id', 'profile_banner_url', 'profile_image_url', 'protected', 'public_metrics', 'receives_your_dm', 'subscription_type', 'url', 'username', 'verified', 'verified_type', 'withheld']".
|
|
215
210
|
tweet_fields (array): A comma separated list of Tweet fields to display. Example: "['article', 'attachments', 'author_id', 'card_uri', 'context_annotations', 'conversation_id', 'created_at', 'edit_controls', 'edit_history_tweet_ids', 'entities', 'geo', 'id', 'in_reply_to_user_id', 'lang', 'non_public_metrics', 'note_tweet', 'organic_metrics', 'possibly_sensitive', 'promoted_metrics', 'public_metrics', 'referenced_tweets', 'reply_settings', 'scopes', 'source', 'text', 'username', 'withheld']".
|
|
216
|
-
|
|
211
|
+
|
|
217
212
|
Returns:
|
|
218
213
|
dict[str, Any]: The request has succeeded.
|
|
219
|
-
|
|
214
|
+
|
|
220
215
|
Raises:
|
|
221
216
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
222
217
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
223
|
-
|
|
218
|
+
|
|
224
219
|
Tags:
|
|
225
220
|
Direct Messages
|
|
226
221
|
"""
|
|
@@ -247,9 +242,9 @@ class DmConversationsApi(APISegmentBase):
|
|
|
247
242
|
|
|
248
243
|
def list_tools(self):
|
|
249
244
|
return [
|
|
250
|
-
self.
|
|
251
|
-
self.
|
|
252
|
-
self.
|
|
253
|
-
self.
|
|
254
|
-
self.
|
|
245
|
+
self.create_dm_conversation,
|
|
246
|
+
self.get_dm_events_by_participant_id,
|
|
247
|
+
self.send_dm_by_participant_id,
|
|
248
|
+
self.add_message_to_dm_conversation,
|
|
249
|
+
self.get_dm_events_by_conversation_id,
|
|
255
250
|
]
|
|
@@ -19,9 +19,8 @@ class DmEventsApi(APISegmentBase):
|
|
|
19
19
|
tweet_fields=None,
|
|
20
20
|
) -> dict[str, Any]:
|
|
21
21
|
"""
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
Retrieves a list of direct message events, unlike `get_dm_events_by_id` which fetches a single event. Supports pagination, filtering by event type, and specifying which data fields to return for various objects to customize the API response.
|
|
23
|
+
|
|
25
24
|
Args:
|
|
26
25
|
max_results (integer): Limits the number of DM events returned in the response, with a default of 100 if not specified.
|
|
27
26
|
pagination_token (string): Optional token used to specify the starting point for paginating the response of DM events.
|
|
@@ -31,14 +30,14 @@ class DmEventsApi(APISegmentBase):
|
|
|
31
30
|
media_fields (array): A comma separated list of Media fields to display. Example: "['alt_text', 'duration_ms', 'height', 'media_key', 'non_public_metrics', 'organic_metrics', 'preview_image_url', 'promoted_metrics', 'public_metrics', 'type', 'url', 'variants', 'width']".
|
|
32
31
|
user_fields (array): A comma separated list of User fields to display. Example: "['affiliation', 'connection_status', 'created_at', 'description', 'entities', 'id', 'location', 'most_recent_tweet_id', 'name', 'pinned_tweet_id', 'profile_banner_url', 'profile_image_url', 'protected', 'public_metrics', 'receives_your_dm', 'subscription_type', 'url', 'username', 'verified', 'verified_type', 'withheld']".
|
|
33
32
|
tweet_fields (array): A comma separated list of Tweet fields to display. Example: "['article', 'attachments', 'author_id', 'card_uri', 'context_annotations', 'conversation_id', 'created_at', 'edit_controls', 'edit_history_tweet_ids', 'entities', 'geo', 'id', 'in_reply_to_user_id', 'lang', 'non_public_metrics', 'note_tweet', 'organic_metrics', 'possibly_sensitive', 'promoted_metrics', 'public_metrics', 'referenced_tweets', 'reply_settings', 'scopes', 'source', 'text', 'username', 'withheld']".
|
|
34
|
-
|
|
33
|
+
|
|
35
34
|
Returns:
|
|
36
35
|
dict[str, Any]: The request has succeeded.
|
|
37
|
-
|
|
36
|
+
|
|
38
37
|
Raises:
|
|
39
38
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
40
39
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
41
|
-
|
|
40
|
+
|
|
42
41
|
Tags:
|
|
43
42
|
Direct Messages
|
|
44
43
|
"""
|
|
@@ -61,21 +60,20 @@ class DmEventsApi(APISegmentBase):
|
|
|
61
60
|
response.raise_for_status()
|
|
62
61
|
return response.json()
|
|
63
62
|
|
|
64
|
-
def
|
|
63
|
+
def delete_dm_event(self, event_id) -> dict[str, Any]:
|
|
65
64
|
"""
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
Deletes a specific Direct Message (DM) event identified by its unique ID. This function issues an authenticated HTTP DELETE request to the API to permanently remove the specified event, returning a confirmation of the deletion.
|
|
66
|
+
|
|
69
67
|
Args:
|
|
70
68
|
event_id (string): event_id
|
|
71
|
-
|
|
69
|
+
|
|
72
70
|
Returns:
|
|
73
71
|
dict[str, Any]: The request has succeeded.
|
|
74
|
-
|
|
72
|
+
|
|
75
73
|
Raises:
|
|
76
74
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
77
75
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
78
|
-
|
|
76
|
+
|
|
79
77
|
Tags:
|
|
80
78
|
Direct Messages
|
|
81
79
|
"""
|
|
@@ -87,7 +85,7 @@ class DmEventsApi(APISegmentBase):
|
|
|
87
85
|
response.raise_for_status()
|
|
88
86
|
return response.json()
|
|
89
87
|
|
|
90
|
-
def
|
|
88
|
+
def get_dm_event_by_id(
|
|
91
89
|
self,
|
|
92
90
|
event_id,
|
|
93
91
|
dm_event_fields=None,
|
|
@@ -97,9 +95,8 @@ class DmEventsApi(APISegmentBase):
|
|
|
97
95
|
tweet_fields=None,
|
|
98
96
|
) -> dict[str, Any]:
|
|
99
97
|
"""
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
Fetches a specific Direct Message event using its unique ID. Optional parameters allow customizing the response by selecting specific fields for the event, media, users, and tweets, and by including expanded object details. This differs from `get_dm_events`, which retrieves a list of events.
|
|
99
|
+
|
|
103
100
|
Args:
|
|
104
101
|
event_id (string): event_id
|
|
105
102
|
dm_event_fields (array): A comma separated list of DmEvent fields to display. Example: "['attachments', 'created_at', 'dm_conversation_id', 'entities', 'event_type', 'id', 'participant_ids', 'referenced_tweets', 'sender_id', 'text']".
|
|
@@ -107,14 +104,14 @@ class DmEventsApi(APISegmentBase):
|
|
|
107
104
|
media_fields (array): A comma separated list of Media fields to display. Example: "['alt_text', 'duration_ms', 'height', 'media_key', 'non_public_metrics', 'organic_metrics', 'preview_image_url', 'promoted_metrics', 'public_metrics', 'type', 'url', 'variants', 'width']".
|
|
108
105
|
user_fields (array): A comma separated list of User fields to display. Example: "['affiliation', 'connection_status', 'created_at', 'description', 'entities', 'id', 'location', 'most_recent_tweet_id', 'name', 'pinned_tweet_id', 'profile_banner_url', 'profile_image_url', 'protected', 'public_metrics', 'receives_your_dm', 'subscription_type', 'url', 'username', 'verified', 'verified_type', 'withheld']".
|
|
109
106
|
tweet_fields (array): A comma separated list of Tweet fields to display. Example: "['article', 'attachments', 'author_id', 'card_uri', 'context_annotations', 'conversation_id', 'created_at', 'edit_controls', 'edit_history_tweet_ids', 'entities', 'geo', 'id', 'in_reply_to_user_id', 'lang', 'non_public_metrics', 'note_tweet', 'organic_metrics', 'possibly_sensitive', 'promoted_metrics', 'public_metrics', 'referenced_tweets', 'reply_settings', 'scopes', 'source', 'text', 'username', 'withheld']".
|
|
110
|
-
|
|
107
|
+
|
|
111
108
|
Returns:
|
|
112
109
|
dict[str, Any]: The request has succeeded.
|
|
113
|
-
|
|
110
|
+
|
|
114
111
|
Raises:
|
|
115
112
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
116
113
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
117
|
-
|
|
114
|
+
|
|
118
115
|
Tags:
|
|
119
116
|
Direct Messages
|
|
120
117
|
"""
|
|
@@ -137,4 +134,4 @@ class DmEventsApi(APISegmentBase):
|
|
|
137
134
|
return response.json()
|
|
138
135
|
|
|
139
136
|
def list_tools(self):
|
|
140
|
-
return [self.get_dm_events, self.
|
|
137
|
+
return [self.get_dm_events, self.delete_dm_event, self.get_dm_event_by_id]
|
|
@@ -11,21 +11,20 @@ class LikesApi(APISegmentBase):
|
|
|
11
11
|
self, backfill_minutes=None, start_time=None, end_time=None
|
|
12
12
|
) -> Any:
|
|
13
13
|
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Streams compliance-related data for 'like' events, such as un-likes, with optional time and backfill filters. This endpoint is for compliance monitoring, differing from the firehose and sample streams which provide real-time like creation events.
|
|
15
|
+
|
|
17
16
|
Args:
|
|
18
17
|
backfill_minutes (integer): Specifies the number of minutes of missed data to recover in case of a disconnection, allowing retrieval of up to five minutes of past data.
|
|
19
18
|
start_time (string): The optional start_time query parameter specifies the earliest timestamp from which to retrieve compliance stream data. Example: '2021-02-01T18:40:40.000Z'.
|
|
20
19
|
end_time (string): Optional end time to filter the compliance stream, specified as a string. Example: '2021-02-01T18:40:40.000Z'.
|
|
21
|
-
|
|
20
|
+
|
|
22
21
|
Returns:
|
|
23
22
|
Any: The request has succeeded.
|
|
24
|
-
|
|
23
|
+
|
|
25
24
|
Raises:
|
|
26
25
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
27
26
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
28
|
-
|
|
27
|
+
|
|
29
28
|
Tags:
|
|
30
29
|
Compliance
|
|
31
30
|
"""
|
|
@@ -43,7 +42,7 @@ class LikesApi(APISegmentBase):
|
|
|
43
42
|
response.raise_for_status()
|
|
44
43
|
return response.json()
|
|
45
44
|
|
|
46
|
-
def
|
|
45
|
+
def get_likes_firehose_stream(
|
|
47
46
|
self,
|
|
48
47
|
partition,
|
|
49
48
|
backfill_minutes=None,
|
|
@@ -55,9 +54,8 @@ class LikesApi(APISegmentBase):
|
|
|
55
54
|
tweet_fields=None,
|
|
56
55
|
) -> dict[str, Any]:
|
|
57
56
|
"""
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
Streams a comprehensive, real-time 'firehose' of all like events from a specified data partition. This function allows time-based filtering and customization of returned fields, providing a complete data flow distinct from the compliance or sampled stream methods.
|
|
58
|
+
|
|
61
59
|
Args:
|
|
62
60
|
partition (integer): The partition query parameter specifies the integer identifier of the data subset or bucket to stream from the firehose endpoint, enabling segmented retrieval of likes data.
|
|
63
61
|
backfill_minutes (integer): The number of minutes (up to five) to backfill and recover missed data from the stream after a disconnection.
|
|
@@ -67,14 +65,14 @@ class LikesApi(APISegmentBase):
|
|
|
67
65
|
expansions (array): A comma separated list of fields to expand. Example: "['liked_tweet_author_id', 'liked_tweet_id']".
|
|
68
66
|
user_fields (array): A comma separated list of User fields to display. Example: "['affiliation', 'connection_status', 'created_at', 'description', 'entities', 'id', 'location', 'most_recent_tweet_id', 'name', 'pinned_tweet_id', 'profile_banner_url', 'profile_image_url', 'protected', 'public_metrics', 'receives_your_dm', 'subscription_type', 'url', 'username', 'verified', 'verified_type', 'withheld']".
|
|
69
67
|
tweet_fields (array): A comma separated list of Tweet fields to display. Example: "['article', 'attachments', 'author_id', 'card_uri', 'context_annotations', 'conversation_id', 'created_at', 'edit_controls', 'edit_history_tweet_ids', 'entities', 'geo', 'id', 'in_reply_to_user_id', 'lang', 'non_public_metrics', 'note_tweet', 'organic_metrics', 'possibly_sensitive', 'promoted_metrics', 'public_metrics', 'referenced_tweets', 'reply_settings', 'scopes', 'source', 'text', 'username', 'withheld']".
|
|
70
|
-
|
|
68
|
+
|
|
71
69
|
Returns:
|
|
72
70
|
dict[str, Any]: The request has succeeded.
|
|
73
|
-
|
|
71
|
+
|
|
74
72
|
Raises:
|
|
75
73
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
76
74
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
77
|
-
|
|
75
|
+
|
|
78
76
|
Tags:
|
|
79
77
|
Likes
|
|
80
78
|
"""
|
|
@@ -97,7 +95,7 @@ class LikesApi(APISegmentBase):
|
|
|
97
95
|
response.raise_for_status()
|
|
98
96
|
return response.json()
|
|
99
97
|
|
|
100
|
-
def
|
|
98
|
+
def likes_sample10_stream(
|
|
101
99
|
self,
|
|
102
100
|
partition,
|
|
103
101
|
backfill_minutes=None,
|
|
@@ -109,9 +107,8 @@ class LikesApi(APISegmentBase):
|
|
|
109
107
|
tweet_fields=None,
|
|
110
108
|
) -> dict[str, Any]:
|
|
111
109
|
"""
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
Streams a 10% sample of real-time like events, a low-volume alternative to the full firehose stream. It allows filtering by partition and time range, and supports data enrichment by specifying tweet, user, and expansion fields to customize the response.
|
|
111
|
+
|
|
115
112
|
Args:
|
|
116
113
|
partition (integer): The partition query parameter specifies the integer identifier of the data partition to retrieve in the sample10 likes stream.
|
|
117
114
|
backfill_minutes (integer): Optional integer parameter to specify the number of minutes of missed data to recover, used for reconnecting after a disconnection in the stream.
|
|
@@ -121,14 +118,14 @@ class LikesApi(APISegmentBase):
|
|
|
121
118
|
expansions (array): A comma separated list of fields to expand. Example: "['liked_tweet_author_id', 'liked_tweet_id']".
|
|
122
119
|
user_fields (array): A comma separated list of User fields to display. Example: "['affiliation', 'connection_status', 'created_at', 'description', 'entities', 'id', 'location', 'most_recent_tweet_id', 'name', 'pinned_tweet_id', 'profile_banner_url', 'profile_image_url', 'protected', 'public_metrics', 'receives_your_dm', 'subscription_type', 'url', 'username', 'verified', 'verified_type', 'withheld']".
|
|
123
120
|
tweet_fields (array): A comma separated list of Tweet fields to display. Example: "['article', 'attachments', 'author_id', 'card_uri', 'context_annotations', 'conversation_id', 'created_at', 'edit_controls', 'edit_history_tweet_ids', 'entities', 'geo', 'id', 'in_reply_to_user_id', 'lang', 'non_public_metrics', 'note_tweet', 'organic_metrics', 'possibly_sensitive', 'promoted_metrics', 'public_metrics', 'referenced_tweets', 'reply_settings', 'scopes', 'source', 'text', 'username', 'withheld']".
|
|
124
|
-
|
|
121
|
+
|
|
125
122
|
Returns:
|
|
126
123
|
dict[str, Any]: The request has succeeded.
|
|
127
|
-
|
|
124
|
+
|
|
128
125
|
Raises:
|
|
129
126
|
HTTPError: Raised when the API request fails (e.g., non-2XX status code).
|
|
130
127
|
JSONDecodeError: Raised if the response body cannot be parsed as JSON.
|
|
131
|
-
|
|
128
|
+
|
|
132
129
|
Tags:
|
|
133
130
|
Likes
|
|
134
131
|
"""
|
|
@@ -154,6 +151,6 @@ class LikesApi(APISegmentBase):
|
|
|
154
151
|
def list_tools(self):
|
|
155
152
|
return [
|
|
156
153
|
self.get_likes_compliance_stream,
|
|
157
|
-
self.
|
|
158
|
-
self.
|
|
154
|
+
self.get_likes_firehose_stream,
|
|
155
|
+
self.likes_sample10_stream,
|
|
159
156
|
]
|