Skip to content

Instantly share code, notes, and snippets.

@Sunitha
Created October 27, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sunitha/844a5c8f5cf7435bf9a908ee35242610 to your computer and use it in GitHub Desktop.
Save Sunitha/844a5c8f5cf7435bf9a908ee35242610 to your computer and use it in GitHub Desktop.
a userscript to navigate to another URL which has a better text on amazon.co.jp
var href = location.href;
var mt = href.match(/https:\/\/twitter.com\/intent\/tweet?.*.text=(.*).related=.url=(.*).via=/);
if (mt) {
var text = mt[1];
var url = mt[2];
var new_url = "https://twitter.com/intent/tweet?.*&text=" + text + "&url=" + url;
location.href = new_url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment