#Fixup x.com/Twitter & translate tweet
1 messages · Page 1 of 1 (latest)
Fixup X/FxTwitter and translate tweet in the same commands
Use regex
Use Fixup X or Fxtwitter and translate the text to your language
X URL
Find: (https:\/\/)x\.com(\/[^/]+\/[^/]+)(\$?.*)?$ Replace: $1fixupx.com$2$3/ptReplace PT in "replace" to change to translate to your language
Twitter URL
Replace: $1fxtwitter.com$2$3/ptReplace PT in "replace" to change to translate to your language
cool, thx. Here’s a merge of the two and other optimizations and fixes:
Find:
https:\/\/(twitter|x)\.com\/([^\s\)\]\}]+)
Replace:
https://fxtwitter.com/$2/pt
untested. lmk if you test it
Fixup x.com/Twitter & translate tweet
when getting the x link in copy link in twitter is not translating
i think that need to remove this from the end of x link "?s=20"
https://fxtwitter.com/Xbox/status/1720554020786647182/pt is translated with the command
https://fxtwitter.com/Xbox/status/1720554020786647182?s=20/pt this type of link, dont translate
in case there ever are useful parameters, this should preserve them in the right place:
Find:
https:\/\/(twitter|x)\.com\/([^?\s\)\]\}]+)(\?[^\s\)\]\}]+)?
Replace:
https://fxtwitter.com/$2/pt$3
untested. lmk if you test it
but you can also purge them if you prefer, by omitting the $3 at the end of the replacement
let me test
any idea what the s=20 means/does?
no, but s=20 is always inserted when you use copy link in a tweet
but your new replace, placing s=20 after /pt fixed the translation
but s=20 can be removed of the link too
maybe it stands for source and is just an id code for the place you got the link
ty @ deleted msg:
https://fxtwitter.com/scorpionoxvoid/status/1202199959128309760/pt?s=20
[I think it's a tracker to determine the origin of the share.
?s=19 (from Android mobile devices)
?s=20 (from Windows devices)
?s=21 (from iOS devices, I think)]
i think this current version will also break from (the tracking) parameters
Yes, this first version suffered from this same problem, but thanks to you I saw what was causing it, I think it would be good for me to edit this first version and copy your corrected one in its place to prevent people from using a version that doesn't work 100% .
yeah
Here's a regex rule that checks if it's a status too; for both twitter and x
Find: http(?:s)?://(?:www\.)?(?:twitter|x)\.com(/[^/]+/status/\d+)
Replace: https://fxtwitter.com$1```
just under the conversation of ethics, i (personally) think it'd be better to use vxtwitter, particularly after the allegations against fxtwitter's author:
https://vxtwitter.com/DaisyQUniverse/status/1729578781969453325
I personally did this regex which seems to do the job:
https:\/\/(twitter|x)\.com\/([^?\s\)\]\}]+)\/(\d+)
Especially in terms of only targeting URLs that actually are status ones (I think).
Not a regex expert, so don't know about any possible cases this wouldn't capture
Replace would be https://fxtwitter.com/$2/$3
Actually changed my setup to this:
Regex: https:\/\/(?:twitter|x)\.com\/(?<user>[a-zA-Z0-9_]{4,15})\/status\/(?<id>\d+)(?:\?.+)?
Result: https://fxtwitter.com/$<user>/status/$<id>
Gets rid of the tracking garbage and kinda validates users (Usernames can only be between 4 and 15 characters in length from what I gathered)
I added onto the previously shared setup the ability to detect any extra parameters that fxtwitter supports (like embedding a specific image or translating the post) and figured I would share:
Regex:
https:\/\/(?:twitter|x)\.com\/(?<user>[a-zA-Z0-9_]{3,15})\/status\/(?<id>\d+)?(?:\?[^\/]+)?(\/{1})?
Replace:
https://fxtwitter.com/$<user>/status/$<id>/
I added the ability to use the subdomains of fxtwitter for gallery, text-only and direct media
Regex:
https:\/\/(?<type>[dgt]\.)?(?:twitter|x)\.com\/(?<user>[a-zA-Z0-9_]{4,15})\/status\/(?<id>\d+)?(?:\?[^\/]+)?(\/{1})?
Replace:
https://$<type>fxtwitter.com/$<user>/status/$<id>/
Using that rule, it works for almost any twitter/x link, but i dont know why dont work for that specific url https://x.com/IGN/status/1828900636995314075
ahhhh I see the issue, it's because the original version assumes twitter handles are required to be at least 4 characters long. I updated my post with the updated regex pattern which should match it. alternatively you can just change {4,15} in your plugin settings to {3,15}
Yes, i just found the answer, i fixed changing to 1,15, chatgpt helped me lol
But thanks anyway
English would be en right?