|
|
Hi Guys,
is modified from
to
As you can see I want to append proxy server link before the RS link. After reading forums I tried using re-direction script as following but no success // ==UserScript== // @name RS Link Redirect // @include http://rapidshare.com/files/* // ==/UserScript== document.location.replace(document.location.href.replace(/\/http://rapidshare.com/files/\//, "/http://freeproxy.com/nph-proxy.cgi/000010A/http://rapidshare.com/files//")) Can someone pls help me in making this script? I think it a simple one but due to lack of programming knowledge I am unable to make it work. Thnx in advance |
|
|
amm... try this.. it helped me.. :
|
|
|
DMaster thnx for the reply but script doesn't help me at all... I need to access rapidshare via cgi proxy as direct access to RS is blocked at my place.. Thats why I need some small script customizing the RS links |
|
|
thanks to avg!
|
|
|
Can someone pls help me in writing this script to redirect files to cgi proxy? |
|
|
Use one of the following sites:
|
|
|
I don't know why everyone seems to have ignored the original post. @mgforce: Try this.. document.location.replace(document.location.href.replace(/http:\/\/rapidshare\.com\/files\//, "http://freeproxy.com/nph-proxy.cgi/000010A/http://rapidshare.com/files/")) Although it might be easier to simply do this.. location.replace("http://freeproxy.com/nph-proxy.cgi/000010A/" + location.href)
|
|
|
Thanks znerp... I will try it & update you on the results.. Update 1
I tried both.. is it because I have other RS scripts installed? Update 2
first it opens the normal RS download page.. after few seconds it gets redirected. Can something be done to avoid opening RS page & bypassing that & redirectto the proxy only. Thanks a ton |
|
|
Can something be done to avoid opening RS page & bypassing that & redirectto the proxy only. Greasemonkey scripts only run after the page has loaded fully, hence why you're experiencing this lag. It would be possible to remove this though if you change the link on the page you're coming from. Of course, this could mean that you'll slow down every page this script runs on. Anyhow, you can do that like this.. var rapidshareLinks = document.evaluate('//a[starts-with(@href, "http://rapidshare.com/files/")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (i = rapidshareLinks.snapshotLength - 1; i >= 0; i--)
rapidshareLinks.snapshotItem(i).href = "http://freeproxy.com/nph-proxy.cgi/000010A/" + rapidshareLinks.snapshotItem(i).href;
|
|
|
ok.. if thats the case then I am more than happy to use the same script. one last request.. is it possible that for these RS links I can get option to open the links in background page rather than same page. Thanks again for all the help znerp |
|
|
Change the last line to the following:
|
|
|
Thanks dob In case I am using following script
can I still use the code mentioned by you?? I am not using last script posted by znerp bcoz he mentioned it will slow page loading |
|
|
Go ahead and use znerps script. it won't be all that slow.
The function GM_openInTab() needs some href as a parameter, in this case it's the link's href that is clicked. If you want to use it otherwise, you still need to launch it if something happens (event). |
|
|
OK.. this is what I tried
var rapidshareLinks = document.evaluate('//a[starts-with(@href, "http://rapidshare.com/files/")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (i = rapidshareLinks.snapshotLength - 1; i >= 0; i--)
rapidshareLinks.snapshotItem(i).addEventListener("click", function(e) {
e.preventDefault();
e.stopPropagation();
GM_openInTab("http://freeproxy.com/nph-proxy.cgi/000010A/" + this.href);
}, false);
but doesn't seem to be working.. any idea why ? The link just opens as usual as Rapidshare download... no redirect to proxy even after 10 seconds |
|
|
can anyone help me pls ? |
|
|
code works find on my firefox
|
|
|
yes.. the link used just as example... so you are saying that on using that code rapidshare links are opening in background tab??? but in my firefox they open is same page. why not just change the href rather than adding an event listner? and how can that be done.. pls excuse me for my ignorance but I have no programming knowledge. |
|
|
you could also do this:
|
|
|
Thanks dob.. I will try it & let you know whether it works or not.. the one suggested yesterday is not working |
|
|
Ok.. I tried it.. but same as earlier... the rapidshare link is opening in the same page.. I am using following.. // ==UserScript==
// @name RS via CGI
// @namespace 1
// @description Redirects RS links to open through CGI proxy
// @include http://rapidshare.com/files*
// ==/UserScript==
var rapidshareLinks = document.evaluate('//a[starts-with(@href, "http://rapidshare.com/files/")]', document, null, 6, null);
for (i = rapidshareLinks.snapshotLength - 1; i >= 0; i--) {
rapidshareLinks.snapshotItem(i).href = "http://freeproxy.com/nph-proxy.cgi/000010A"+rapidshareLinks.snapshotItem(i).href;
rapidshareLinks.snapshotItem(i).target = "_blank";
ok.. got my mistake.. @ include selection was wrong.. I changed from http://rapidshare.com/files* to http://* Now working.. thanks to all for the help & time |