v0.2: twitter module, feed/notifications/reply/open_link tools, dashboard

This commit is contained in:
2026-09-11 02:20:13 +08:00
parent a4f33f456e
commit eaedf4f409
6 changed files with 1368 additions and 24 deletions
+33
View File
@@ -156,10 +156,43 @@ TIKTOK = {
"login_marker": 'a[href*="/login"]',
}
# --------------------------------------------------------------------------
# Twitter / X
# --------------------------------------------------------------------------
TWITTER = {
"url": "https://x.com/home",
"compose_url": "https://x.com/compose/post",
# The main tweet box is a DraftJS contenteditable inside the compose dialog
"composer_textbox": '[data-testid="tweetTextarea_0"] [contenteditable="true"]',
# Fallback: the inline composer on the home timeline
"inline_composer": '[data-testid="tweetTextarea_0"]',
"post_button_js": (
"document.querySelector('[data-testid=\"tweetButtonInline\"]')"
" || document.querySelector('[data-testid=\"tweetButton\"]')"
),
"file_input": 'input[type="file"][accept*="image"]',
"media_button": '[data-testid="fileInput"]',
# After posting, the compose dialog closes or the timeline updates
"toast_text": "Your post was sent",
"login_marker": 'a[href="/login"], a[href*="flow/login"], input[name="text"][autocomplete="username"]',
# For reading feeds
"tweet_article": 'article[data-testid="tweet"]',
"tweet_text": '[data-testid="tweetText"]',
"tweet_user": '[data-testid="User-Name"]',
"reply_button": '[data-testid="reply"]',
"following_tab_js": (
"[...document.querySelectorAll('[role=\"tab\"], a[role=\"tab\"]')]"
".find(t => t.innerText.trim() === 'Following')"
),
"search_url": "https://x.com/search?q={query}&src=typed_query&f=live",
}
PLATFORMS = {
"threads": THREADS,
"fb": FACEBOOK,
"ig": INSTAGRAM,
"yt": YOUTUBE,
"tiktok": TIKTOK,
"twitter": TWITTER,
}