rapidshare links checker
|
|
hello i need rapidshare links checker for my forum(smf) if one rapidshare link deleted to write under the post that is deleted |
|
|
// ==UserScript==
// @name Rapidshare Link Checker
// @namespace http://userscripts.org/users/33515/scripts
// @description Checks if rapidshare.com links have are invalid. If so, the links will be marked.
// @include *
// ==/UserScript==
var links = document.getElementsByTagName("a");
for (var i=0; i<links.length; i++) {
if (links[i].href.match(/^http:\/\/(www\.)?rapidshare\.com\/files\/\d+\/.+/gi)) {
GM_xmlhttpRequest({
method: "GET",
url: links[i].href,
onload: function(e) {
if (e.responseText.indexOf("File not found") > -1 || e.responseText.indexOf("This file has been deleted") > -1) {
links[i].style.textDecoration = "line-through";
links[i].title = "This link is invalid";
//links[i].setAttribute("style", "text-decoration:line-through;");
//links[i].setAttribute("title", "This link is invalid.");
}
}
});
}
}
If the link is invalid, the link will look something like this: I couldn't test it, since you didn't think so far as to post 2 links that have been deleted/are invalid, but I believe it will work. And next time, try asking a little friendlier, a simple "please" would be nice ;) |
|
|
is it just me or should it be |
|
|
Ah, Crap :D Of course you're right :) |
|
|
@sizzlemctwizzle
@john34516
|
|
|
Well, your script looks a little overkill to me.
And why is your script so complicated? Is there a reason for that? I didn't look through your code, but it seems very, very overloaded to me. |
|
|
You think that's complex, should see my local version.
It's easy to find links, just do a Google search. BTW: I know there are cases when I should be using switch, but I usually start out with one if and it sometimes breeds but I never go back and rewrite using switch, either because I'm not used to using it or I'm just lazy. |
|
|
hello how i can use that code on my site ? please help me |
|
|
Is it PHP? You can use one of these scripts but you need one that shows the Content-Type header, as the status code won't tell you anything. Maybe you can post that link to the smf guys, though they likely already know.
You guys have at it, I'm getting a bit tired of "please help me" posters. |

