Closed narodnik closed 1 day ago
I found this link: https://devcommunity.x.com/t/how-to-post-280-4000-characters-via-api-v2/191156
so if tweety could do this then it would be able to do sth the normal API cannot do ;)
Is this a good tool to intercept SSL traffic or do you recommend another workflow?
https://docs.mitmproxy.org/stable/overview-getting-started/
edit: ok I used my browser's inbuilt tools, here's what I've got for a short tweet:
{
"variables": {
"tweet_text": "dddd",
"dark_request": false,
"media": {
"media_entities": [],
"possibly_sensitive": false
},
"semantic_annotation_ids": [],
"disallowed_reply_options": null
},
"features": {
"communities_web_enable_tweet_community_results_fetch": true,
"c9s_tweet_anatomy_moderator_badge_enabled": true,
"tweetypie_unmention_optimization_enabled": true,
"responsive_web_edit_tweet_api_enabled": true,
"graphql_is_translatable_rweb_tweet_is_translatable_enabled": true,
"view_counts_everywhere_api_enabled": true,
"longform_notetweets_consumption_enabled": true,
"responsive_web_twitter_article_tweet_consumption_enabled": true,
"tweet_awards_web_tipping_enabled": false,
"creator_subscriptions_quote_tweet_preview_enabled": false,
"longform_notetweets_rich_text_read_enabled": true,
"longform_notetweets_inline_media_enabled": true,
"articles_preview_enabled": true,
"rweb_video_timestamps_enabled": true,
"rweb_tipjar_consumption_enabled": true,
"responsive_web_graphql_exclude_directive_enabled": true,
"verified_phone_label_enabled": false,
"freedom_of_speech_not_reach_fetch_enabled": true,
"standardized_nudges_misinfo": true,
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": true,
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": false,
"responsive_web_graphql_timeline_navigation_enabled": true,
"responsive_web_enhance_cards_enabled": false
},
"queryId": "..."
}
but when I made a long tweet, instead it called CreateNoteTweet
, and here's the POST data:
{
"variables": {
"tweet_text": "....",
"dark_request": false,
"media": {
"media_entities": [],
"possibly_sensitive": false
},
"semantic_annotation_ids": [],
"disallowed_reply_options": null
},
"features": {
"communities_web_enable_tweet_community_results_fetch": true,
"c9s_tweet_anatomy_moderator_badge_enabled": true,
"tweetypie_unmention_optimization_enabled": true,
"responsive_web_edit_tweet_api_enabled": true,
"graphql_is_translatable_rweb_tweet_is_translatable_enabled": true,
"view_counts_everywhere_api_enabled": true,
"longform_notetweets_consumption_enabled": true,
"responsive_web_twitter_article_tweet_consumption_enabled": true,
"tweet_awards_web_tipping_enabled": false,
"creator_subscriptions_quote_tweet_preview_enabled": false,
"longform_notetweets_rich_text_read_enabled": true,
"longform_notetweets_inline_media_enabled": true,
"articles_preview_enabled": true,
"rweb_video_timestamps_enabled": true,
"rweb_tipjar_consumption_enabled": true,
"responsive_web_graphql_exclude_directive_enabled": true,
"verified_phone_label_enabled": false,
"freedom_of_speech_not_reach_fetch_enabled": true,
"standardized_nudges_misinfo": true,
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": true,
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": false,
"responsive_web_graphql_timeline_navigation_enabled": true,
"responsive_web_enhance_cards_enabled": false
},
"queryId": "..."
}```
so it's basically the same API with just a different function name.
This is the URL: `https://x.com/i/api/graphql/0aWhJJmFlxkxv9TAUJPanA/CreateNoteTweet`
Yes Long tweet required to be sent to CreateNoteTweet
, it will be added in next release
BTW I notice a few differences between builder.py
and my output above:
"tweet_awards_web_tipping_enabled": false,
"creator_subscriptions_quote_tweet_preview_enabled": false,
"verified_phone_label_enabled": false,
I'm looking at the code in tweety, and it seems to be an error from Twitter. So maybe there's an alternative method we need to call?
How do you debug this? Are you using wireshark to examine the network traffic, or how can I examine the API?