Twat Doc Userscript Documentation
This userscript enhances the X (formerly Twitter) experience by providing customizable content filters, automuting, and various quality-of-life improvements. Below is a succinct description of each content handler available in the script. These handlers process posts in feeds, allowing removal, modification, or scoring based on specific criteria. Enable or disable them via the settings; they activate on the next feed load without requiring a full page refresh. Note that enabling many handlers may cause performance issues on slower devices.
Note: Content is not removed from feeds unless [code]general > enableDeletes[/code] is enabled. Otherwise, it will display the qualifying information in the post template.
About content removal: X tracks viewed content in For You feeds. Removing posts from API responses before they appear in the feed may cause X to contuously refetch them, potentially blocking new content while X attempts to clear its internal content delivery queues. The [code]experimental > clickNotInterestedIn[/code] option allows such posts through, but auto-clicks "Not interested in this post" in the caret menu, notifying X via API to stop showing them and hopefully improve feed flow. Enable with deletes if feeds appear stagnant or empty.
BannedText
Flags and scores authors based on indicators like pronouns, specific emojis (e.g., 🏳️⚧️, 🏳🌈, 🍉, 💉), or hashtags (e.g., #ACAB, #BLM) in posts, with lower scores for more matches. Supports automuting if scores hit thresholds. Processor-intensive due to regex usage; optional flag emoji checks (e.g., 🇪🇺, 🇮🇳) are experimental and may yield false positives.

SeenPosts
Tracks and hides previously viewed posts stored in browser local storage, with cleanup schedules based on hours to prevent localStorage bloat. Configurable age and view count thresholds for hiding; optional auto-click of 'Not interested' in post menus to influence platform algorithms (use cautiously).


Visual Settings
Enhances the user interface and display elements on X for better usability and accessibility. These options modify post templates, timestamps, and media handling without altering core functionality.
- disableContentClickEvent: Disables the full-post click event that opens posts accidentally; limits opens to timestamp or quoted content clicks, improving precision for interactions like likes or menus.
- betterContentTimestamps: Converts absolute dates (e.g., 'Sep 3') to relative formats (e.g., '1.95d' for days/hours ago) for easier age assessment.
- betterContentTimestampThresholdDays: Reverts to native X format for posts older than this day threshold to avoid unclear relative timestamps like '5.6y'.
- largerContentInteractionButtons: Enlarges like, reply, and other buttons at post bottoms for easier clicking.
- showVideoUrls: Displays direct MP4 links with resolutions in video posts; enables browser playback or downloads without Premium.
Video links added to post template:
Lang
Filters out foreign-language posts from feeds, especially in trends and searches. Configurable language confidence thresholds reduce mislabeling errors; options to hide banned languages or Grok-translated posts. Recommend adding language filters like 'lang:en' in [code]search > args[/code] for backend enforcement.

UserContent
Provides granular control over content types from users, including allowing or hiding reposts, quotes, self-reposts, self-quotes, and unavailable quotes. Ideal for reducing self-promotion or redundant content.

ViewLikeRatios
Analyzes engagement metrics like view-to-follower or like-to-follower ratios to identify potentially biased or low-quality content. Configurable like count thresholds; options to show extended metrics or always display ratios for all posts.
MutedBlocked
Forcibly removes content from muted, blocked, or blocking accounts, including their reposts and quotes, even in feeds where X normally shows them (e.g., profiles, communities).


RemoveNonrepliesOnRepliesFeed
Cleans the Replies tab in user profiles by removing non-reply content like posts, reposts, and quotes.
Communities
Removes all community-related content from feeds like For You or trends. Future plans include whitelisting joined communities.

SubLock
Removes subscription-locked posts. Untested with subscribed accounts; may affect promoted content from followed subscriptions.

UserAccount
Controls visibility based on account attributes, such as hiding content from users with default profile pictures.
TagSpam
Cleans up feeds flooded with hashtag and mention spam, especially in political trends. Configurable thresholds hide posts exceeding a set number of hashtags or mentions. Applies universally to all feeds.
SearchSpam
Detects and notifies about users spamming trends or searches by tracking post counts in feeds. Includes optional scoring multipliers to adjust user quality scores based on post frequency, aiding in muting spammers. Scoring feature is experimental and may need refinement.
SearchQuality
Improves search result quality by hiding posts where hashtags, mentions, or search terms dominate the content beyond a configurable percentage threshold. Options to include or exclude hashtags, mentions, and search terms in the calculation for targeted filtering.
UnavailableRefPost
Handles removal of posts referencing unavailable content.

Business
Hides content from verified business accounts (yellow/gold star badges).
Symbols
Removes posts containing $ symbols, targeting stock, crypto, or financial content.
Parody
Hides content from accounts marked as parody.
MuskBot
Removes posts from accounts with 'elon' or 'musk' in the name, excluding @elonmusk.
SearchTextInUsername
In searches or trends, hides content from accounts whose usernames contain the search query.
In this example where "Kiefer" was trending, a good portion of the feed results were accounts with "kiefer" in the authors' name fields.

SelfLink
Removes posts with links matching domains in the author's bio. Effective for filtering news or self-promoted content, but may hide legitimate links like YouTubers' own videos.

Future Development or Unrefined Features
These content handlers are either a work in progress or need refinement before they're ready for public use. Many of these are features I began working on to suit my own purposes and may remove content you wish to see. It's best to keep these disabled.
BlackWhite
Alerts on inconsistent capitalization in racial terms (e.g., 'black' capitalized but not 'white'). Currently non-functional and should remain disabled.
VideoGimmick
Hides content from gimmick video accounts based on username patterns. Criteria hardcoded; disable to avoid unintended filtering.
BannedLinks
Removes posts containing hardcoded banned links. User-defined links planned; keep disabled unless matching personal preferences.
ColorCoding
Color-codes posts by age for quick staleness assessment. Disable until colors and thresholds become configurable.
Misc
Miscellaneous experimental filters for testing new features. Keep disabled as they are not fully developed.