You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduces a new xCancelGenerator handler that automatically detects Twitter/X links and provides an alternative xcancel.com link. This ensures that community members can view linked content and threads without being forced to log in to an X account.
Summary Features
Uses Regex to detect only status links from x and twitter -> /https?:\/\/(?:www\.)?(?:x|twitter)\.com\/\w+\/status\/\d+/i.
Suppresses embed of original link if a match has been detected.
Returns a converted link using xcancel.com which allows users to read threads without an account.
New Feature Development
A new feature was added to process messages containing Twitter links and convert them into a more user-friendly URL format. This enhancement was realized through a new file named x-cancel-generator.ts.
Pattern Matching Enhancement
We introduced a pattern matching technique, here represented as TWITTER_REGEX. Its basic function is to identify Twitter status URLs present in the data effectively.
Improved Message Processing
The processing ability of our system has been enhanced by logically ignoring messages from automated sources or bots. Additionally, unnecessary information, known as 'embeds', are now suppressed, contributing to a cleaner user interface. An adequately converted URL is sent to xcancel.com, ensuring the data redirection process is smooth.
Integration Effort
Finally, with the update of index.ts, the newly created feature xCancelGenerator is successfully registered within the main list of handlers, consolidating this improvement with existing functionalities. This ensures the new feature works seamlessly with the existing structure.
`This \`x.com\` link has been converted to \`xcancel.com\` so that server members won't require an account to view content and threads:\n ${alternativeUrl}`,
The reason will be displayed to describe this comment to others. Learn more.
What about trimming it down further? 👀
Suggested change
`This \`x.com\` link has been converted to \`xcancel.com\` so that server members won't require an account to view content and threads:\n ${alternativeUrl}`,
`[Converted to \`xcancel.com\` for members with no X account](${alternativeUrl})`,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduces a new
xCancelGeneratorhandler that automatically detects Twitter/X links and provides an alternativexcancel.comlink. This ensures that community members can view linked content and threads without being forced to log in to an X account.Summary Features
xandtwitter->/https?:\/\/(?:www\.)?(?:x|twitter)\.com\/\w+\/status\/\d+/i.xcancel.comwhich allows users to read threads without an account.Tests
Conducted Tests on RTS prior to finalising PR:
