Created
September 7, 2024 18:43
-
-
Save mvark/46f4cade85a8b0674c90541f5f2ff4c0 to your computer and use it in GitHub Desktop.
Bookmarklet code that extracts the number in Twitter/X.com URL, constructs a Rattibha URL so that content can be read in an easy-to-read format (assuming it is already converted) and then redirects to that page
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
javascript:(function() { | |
var url = window.location.href; | |
var match = url.match(/\/status\/(\d+)/); | |
if (match && match[1]) { | |
var newUrl = "https://en.rattibha.com/thread/" + match[1]; | |
window.location.href = newUrl; | |
} else { | |
alert("No matching thread ID found in the URL."); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment