i want to redirect from the first link to the other using javascript or jquery in greasemonkey
http://*.tumblr.com/post/*/*
http://$1.tumblr.com/image/$2
i want to redirect from the first link to the other using javascript or jquery in greasemonkey
http://*.tumblr.com/post/*/*
http://$1.tumblr.com/image/$2
Use this regex
/^http:\/\/(.*).twitter.com\/post\/(.*)\/(.*)/g
Like this
var regexp = new RegExp(/^http:\/\/(.*).twitter.com\/post\/(.*)\/(.*)/g);
var results = regexp.exec(window.location.href);
To create your array, then you can
if(results){
window.location="http://"+results[1]+".twitter.com/image/"+results[2]+"/"+results[3];
}
To redirect