Skip to content

Instantly share code, notes, and snippets.

@rhenium
Last active August 29, 2015 13:56
Show Gist options
  • Save rhenium/9342076 to your computer and use it in GitHub Desktop.
Save rhenium/9342076 to your computer and use it in GitHub Desktop.
(function() {
var scheme, host, path;
if (location.hostname == "twitter.com") {
scheme = "http"; host = "aclog.koba789.com";
var matches = location.pathname.match(/^(\/\w{1,20})(\/favorites)?(?:(?:\/status(?:es)?)(\/\d+))?$/);
if (matches) {
if (matches[2]) {
path = matches[1] + "/discoveries";
} else if (matches[3]) {
path = "/i" + matches[3];
} else if (matches[1]) {
path = matches[1];
}
}
} else if (location.hostname == "aclog.koba789.com") {
scheme = "https"; host = "twitter.com";
var matches = location.pathname.match(/^(?:\/i(\/\d+)|(\/\w{1,20})(?:(\/discoveries)|.*))$/);
if (matches) {
if (matches[1]) {
path = "/re4k/status" + matches[1];
} else if (matches[3]) {
path = matches[2] + "/favorites";
} else if (matches[2]) {
path = matches[2];
}
}
}
if (scheme && host && path) {
location.href = scheme + "://" + host + path;
}
})();
// uglified
javascript:(function(){var t,i,e;if(location.hostname=="twitter.com"){t="http";i="aclog.koba789.com";var o=location.pathname.match(/^(\/\w{1,20})(\/favorites)?(?:(?:\/status(?:es)?)(\/\d+))?$/);if(o){if(o[2]){e=o[1]+"/discoveries"}else if(o[3]){e="/i"+o[3]}else if(o[1]){e=o[1]}}}else if(location.hostname=="aclog.koba789.com"){t="https";i="twitter.com";var o=location.pathname.match(/^(?:\/i(\/\d+)|(\/\w{1,20})(?:(\/discoveries)|.*))$/);if(o){if(o[1]){e="/re4k/status"+o[1]}else if(o[3]){e=o[2]+"/favorites"}else if(o[2]){e=o[2]}}}if(t&&i&&e){location.href=t+"://"+i+e}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment