Skip to content

Instantly share code, notes, and snippets.

@mvark
Created September 7, 2024 18:43
Show Gist options
  • Save mvark/46f4cade85a8b0674c90541f5f2ff4c0 to your computer and use it in GitHub Desktop.
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
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