2021-12-27 01:37:38 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
2023-04-21 12:41:30 +00:00
|
|
|
import uri, sequtils, strutils
|
2020-06-01 00:16:24 +00:00
|
|
|
|
|
|
|
const
|
2023-08-18 22:25:14 +00:00
|
|
|
consumerKey* = "3nVuSoBZnx6U4vzUxf5w"
|
|
|
|
consumerSecret* = "Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys"
|
2020-06-01 00:16:24 +00:00
|
|
|
|
|
|
|
api = parseUri("https://api.twitter.com")
|
2020-06-24 13:03:18 +00:00
|
|
|
activate* = $(api / "1.1/guest/activate.json")
|
2021-01-07 21:04:19 +00:00
|
|
|
|
2020-06-16 22:20:34 +00:00
|
|
|
photoRail* = api / "1.1/statuses/media_timeline.json"
|
2023-07-21 16:56:39 +00:00
|
|
|
|
2021-01-07 21:04:19 +00:00
|
|
|
graphql = api / "graphql"
|
2023-07-10 09:25:34 +00:00
|
|
|
graphUser* = graphql / "u7wQyGi6oExe8_TRWGMq4Q/UserResultByScreenNameQuery"
|
|
|
|
graphUserById* = graphql / "oPppcargziU1uDQHAUmH-A/UserResultByIdQuery"
|
|
|
|
graphUserTweets* = graphql / "3JNH4e9dq1BifLxAa3UMWg/UserWithProfileTweetsQueryV2"
|
|
|
|
graphUserTweetsAndReplies* = graphql / "8IS8MaO-2EN6GZZZb8jF0g/UserWithProfileTweetsAndRepliesQueryV2"
|
|
|
|
graphUserMedia* = graphql / "PDfFf8hGeJvUCiTyWtw4wQ/MediaTimelineV2"
|
|
|
|
graphTweet* = graphql / "83h5UyHZ9wEKBVzALX8R_g/ConversationTimelineV2"
|
|
|
|
graphTweetResult* = graphql / "sITyJdhRPpvpEjg4waUmTA/TweetResultByIdQuery"
|
2023-04-21 12:41:30 +00:00
|
|
|
graphSearchTimeline* = graphql / "gkjsKepM6gl_HmFWoWKfgg/SearchTimeline"
|
|
|
|
graphListById* = graphql / "iTpgCtbdxrsJfyx0cFjHqg/ListByRestId"
|
|
|
|
graphListBySlug* = graphql / "-kmqNvm5Y-cVrfvBy6docg/ListBySlug"
|
|
|
|
graphListMembers* = graphql / "P4NpVZDqUD_7MEM84L-8nw/ListMembers"
|
2023-07-10 09:25:34 +00:00
|
|
|
graphListTweets* = graphql / "BbGLL1ZfMibdFNWlk7a0Pw/ListTimeline"
|
2021-01-07 21:04:19 +00:00
|
|
|
|
2020-06-01 00:16:24 +00:00
|
|
|
timelineParams* = {
|
|
|
|
"include_can_media_tag": "1",
|
|
|
|
"include_cards": "1",
|
2023-04-21 12:41:30 +00:00
|
|
|
"include_entities": "1",
|
2023-07-22 01:03:45 +00:00
|
|
|
"include_profile_interstitial_type": "0",
|
|
|
|
"include_quote_count": "1",
|
|
|
|
"include_reply_count": "1",
|
|
|
|
"include_user_entities": "1",
|
2023-08-08 00:09:56 +00:00
|
|
|
"include_ext_reply_count": "1",
|
|
|
|
"include_ext_is_blue_verified": "1",
|
|
|
|
"include_ext_media_color": "0",
|
|
|
|
"cards_platform": "Web-13",
|
|
|
|
"tweet_mode": "extended",
|
|
|
|
"send_error_codes": "1",
|
|
|
|
"simple_quoted_tweet": "1"
|
2020-06-01 00:16:24 +00:00
|
|
|
}.toSeq
|
|
|
|
|
2023-04-21 12:41:30 +00:00
|
|
|
gqlFeatures* = """{
|
2023-07-10 09:25:34 +00:00
|
|
|
"android_graphql_skip_api_media_color_palette": false,
|
2023-04-21 12:41:30 +00:00
|
|
|
"blue_business_profile_image_shape_enabled": false,
|
2023-07-10 09:25:34 +00:00
|
|
|
"creator_subscriptions_subscription_count_enabled": false,
|
2023-05-20 00:10:37 +00:00
|
|
|
"creator_subscriptions_tweet_preview_api_enabled": true,
|
2023-04-21 12:41:30 +00:00
|
|
|
"freedom_of_speech_not_reach_fetch_enabled": false,
|
|
|
|
"graphql_is_translatable_rweb_tweet_is_translatable_enabled": false,
|
2023-07-10 09:25:34 +00:00
|
|
|
"hidden_profile_likes_enabled": false,
|
2023-05-20 00:10:37 +00:00
|
|
|
"highlights_tweets_tab_ui_enabled": false,
|
2023-04-21 12:41:30 +00:00
|
|
|
"interactive_text_enabled": false,
|
|
|
|
"longform_notetweets_consumption_enabled": true,
|
2023-05-20 00:10:37 +00:00
|
|
|
"longform_notetweets_inline_media_enabled": false,
|
2023-04-21 12:41:30 +00:00
|
|
|
"longform_notetweets_richtext_consumption_enabled": true,
|
|
|
|
"longform_notetweets_rich_text_read_enabled": false,
|
|
|
|
"responsive_web_edit_tweet_api_enabled": false,
|
|
|
|
"responsive_web_enhance_cards_enabled": false,
|
|
|
|
"responsive_web_graphql_exclude_directive_enabled": true,
|
|
|
|
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": false,
|
|
|
|
"responsive_web_graphql_timeline_navigation_enabled": false,
|
2023-07-10 09:25:34 +00:00
|
|
|
"responsive_web_media_download_video_enabled": false,
|
2023-04-21 12:41:30 +00:00
|
|
|
"responsive_web_text_conversations_enabled": false,
|
2023-07-10 09:25:34 +00:00
|
|
|
"responsive_web_twitter_article_tweet_consumption_enabled": false,
|
2023-04-21 12:41:30 +00:00
|
|
|
"responsive_web_twitter_blue_verified_badge_is_enabled": true,
|
2023-05-20 00:10:37 +00:00
|
|
|
"rweb_lists_timeline_redesign_enabled": true,
|
2023-04-21 12:41:30 +00:00
|
|
|
"spaces_2022_h2_clipping": true,
|
|
|
|
"spaces_2022_h2_spaces_communities": true,
|
|
|
|
"standardized_nudges_misinfo": false,
|
2023-07-10 09:25:34 +00:00
|
|
|
"subscriptions_verification_info_enabled": true,
|
|
|
|
"subscriptions_verification_info_reason_enabled": true,
|
|
|
|
"subscriptions_verification_info_verified_since_enabled": true,
|
|
|
|
"super_follow_badge_privacy_enabled": false,
|
|
|
|
"super_follow_exclusive_tweet_notifications_enabled": false,
|
|
|
|
"super_follow_tweet_api_enabled": false,
|
|
|
|
"super_follow_user_api_enabled": false,
|
2023-04-21 12:41:30 +00:00
|
|
|
"tweet_awards_web_tipping_enabled": false,
|
|
|
|
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": false,
|
|
|
|
"tweetypie_unmention_optimization_enabled": false,
|
2023-07-10 09:25:34 +00:00
|
|
|
"unified_cards_ad_metadata_container_dynamic_card_content_query_enabled": false,
|
2023-04-21 12:41:30 +00:00
|
|
|
"verified_phone_label_enabled": false,
|
|
|
|
"vibe_api_enabled": false,
|
|
|
|
"view_counts_everywhere_api_enabled": false
|
|
|
|
}""".replace(" ", "").replace("\n", "")
|
2023-02-24 00:01:22 +00:00
|
|
|
|
|
|
|
tweetVariables* = """{
|
|
|
|
"focalTweetId": "$1",
|
|
|
|
$2
|
2023-07-10 09:25:34 +00:00
|
|
|
"includeHasBirdwatchNotes": false
|
2023-04-21 12:41:30 +00:00
|
|
|
}"""
|
|
|
|
|
2023-07-22 01:03:45 +00:00
|
|
|
# oldUserTweetsVariables* = """{
|
|
|
|
# "userId": "$1", $2
|
|
|
|
# "count": 20,
|
|
|
|
# "includePromotedContent": false,
|
|
|
|
# "withDownvotePerspective": false,
|
|
|
|
# "withReactionsMetadata": false,
|
|
|
|
# "withReactionsPerspective": false,
|
|
|
|
# "withVoice": false,
|
|
|
|
# "withV2Timeline": true
|
|
|
|
# }
|
|
|
|
# """
|
2023-07-21 16:56:39 +00:00
|
|
|
|
2023-04-21 12:41:30 +00:00
|
|
|
userTweetsVariables* = """{
|
2023-07-10 09:25:34 +00:00
|
|
|
"rest_id": "$1", $2
|
|
|
|
"count": 20
|
2023-02-24 00:01:22 +00:00
|
|
|
}"""
|
|
|
|
|
2023-04-21 12:41:30 +00:00
|
|
|
listTweetsVariables* = """{
|
2023-07-10 09:25:34 +00:00
|
|
|
"rest_id": "$1", $2
|
|
|
|
"count": 20
|
2023-02-24 00:01:22 +00:00
|
|
|
}"""
|