There are 51 previous versions of this script.
Add Syntax Highlighting (this will take a few seconds, probably freezing your browser while it works)
// ==UserScript==
// @name The Cavern Links Checker
// @namespace http://userscripts.org/scripts/show/29222
// @include http://*
// @exclude http://depositfiles.com/*
// @exclude http://ezyfile.net/*
// @exclude http://filefactory.com/*
// @exclude http://gigabyteupload.com/*
// @exclude http://hotfile.com/*
// @include http://hotfile.com/dl/*
// @exclude http://ifile.it/*
// @exclude http://www.mediafire.com/*
// @exclude http://megaupload.com/*
// @exclude http://*.megaupload.com/*
// @exclude http://netload.in/*
// @exclude http://www.megaftp.com/*
// @exclude http://www.netload.in/*
// @exclude http://www.share-online.biz/*
// @exclude http://www.teradepot.com/*
// @exclude http://ugotfile.com/*
// @exclude http://uploading.com/*
//
// @exclude http://www.bitlet.org/*
// @exclude http://www.evernote.com/*
// @exclude https://www.evernote.com/*
// @exclude http://www.tuenti.com/*
// ==/UserScript==
// version 2.83 18 Nov 2009
var local_version = new Number(2.83);
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Variables
////////////////////////////////////////////////////////////////////////////////////////////////////////
var count = 0;
var flag_cavern = false;
var GMHosts = [];
var hosts = [];
var imgs = [];
var numberofrslinks = 0;
var other_alive = [];
var other_dead = [];
var other_maybe = [];
var other_link_qty = 0;
var other_links = [];
var redirs = [];
var rs_links = [];
if (document.URL.search(/http\:\/\/www\.thecavernforum\.com/gi) != -1){flag_cavern = true};
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Read Preferences
////////////////////////////////////////////////////////////////////////////////////////////////////////
var pref1 = GM_getValue("tclc_p1", true);
var pref2 = GM_getValue("tclc_p2", true);
var pref3 = GM_getValue("tclc_p3", ""); if(pref3 == ""){pref3 = "paleGreen"};
var pref4 = GM_getValue("tclc_p4", ""); if(pref4 == ""){pref4 = "lightPink"};
var pref5 = GM_getValue("tclc_p5", true);
var pref6 = GM_getValue("tclc_p6", true);
var pref7 = GM_getValue("tclc_p7", ""); if(pref7 == ""){pref7 = "yellow"};
var pref8 = GM_getValue("tclc_p8", false);
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Check to see if a new version exists
////////////////////////////////////////////////////////////////////////////////////////////////////////
//GM_setValue("checked_for_new_version", 20090101);
var d = new Date();
var dy = d.getFullYear();
var dm = d.getMonth() + 1;
var dd = d.getDate();
var ys = new String(dy);
var ms = new String(dm);
var ds = new String(dd);
if ( ms.length == 1 ) ms = "0" + ms;
if ( ds.length == 1 ) ds = "0" + ds;
ys = parseFloat(ys + ms + ds);
var upd = GM_getValue("checked_for_new_version", 0);
if(ys > upd){
//alert("Need to check_for_new_version");
GM_setValue("checked_for_new_version", ys);
GM_xmlhttpRequest({
method: "GET",
url: 'http://docs.google.com/Doc?id=dgh8sg4s_23g4kqmnfv',
headers:{'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey', 'Content-type':'application/x-www-form-urlencoded'},
data:'',
onload:function(result) {
var res = result.responseText;
var start_pos = res.indexOf("*Version");
var stop_pos = res.indexOf("*", start_pos + 1);
var server_version = new Number(0);
server_version = res.substr(start_pos + 8, (stop_pos - start_pos - 8 ));
get_hosts();
if (server_version > local_version){
alert("There is a new version of The Cavern Links Checker. Redirecting to the install page");
location.replace("http://userscripts.org/scripts/source/29222.user.js");
}
}
});
} else {
get_hosts();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Hosts
// [0] name to categorize links
// [1] search string to hit on
// [2] file_is_alive search string
// [3] file_is_dead search string -- Sometimes it's easier to match on these
// [3] file_is_maybe search string -- Represents different statuses [converting, folder, etc]
////////////////////////////////////////////////////////////////////////////////////////////////////////
hosts.push (["2shared.com",
/http:\/\/www\.2shared\.com/gi,
/Save file to your PC/gi,
"",
""
]);
hosts.push (["4files.net",
/\4files\.net/gi,
"",
/такого файла нет|no such file/gi,
""
]);
hosts.push (["4shared.com",
/\.4shared\.com/gi,
/Download Now/gi,
/class=\"warn\"/gi,
""
]);
//hosts.push (["addat.hu",
// /http:\/\/addat\.hu/gi,
// /kiválasztott fájl/gi,
// /a keresett fájl nem található/gi,
// ""
// ]);
hosts.push (["adrive.com",
/http:\/\/www\.adrive\.com/gi,
/Your file download/gi,
/no longer available/gi,
""
]);
hosts.push (["anyfiles.net",
/http:\/\/www\.anyfiles\.net/gi,
/Download file/gi,
"",
""
]);
hosts.push (["axifile.com",
/http:\/\/www\.axifile\.com/gi,
/file download/gi,
"",
""
]);
hosts.push (["badongo.com",
/http:\/\/(www\.)*badongo\.com/gi,
/publisher\'s virtual Drive|This file has been split|Filesize :/gi,
"",
""
]);
hosts.push (["bitroad.net",
/http:\/\/bitroad\.net/gi,
/Download a file\./gi,
"",
""
]);
hosts.push (["bigandfree.com",
/http:\/\/www\.bigandfree\.com/gi,
/download area/gi,
"",
""
]);
hosts.push (["crazyupload.com",
/http:\/\/www\.crazyupload\.com/gi,
/you have requested/gi,
"",
""
]);
hosts.push (["creafile.com",
/http:\/\/creafile\.com/gi,
/file downloading/gi,
"",
""
]);
hosts.push (["data.hu",
/http:\/\/data\.hu/gi,
/következo fájl letöltése/gi,
/az adott fájl nem létezik/gi,
""
]);
hosts.push (["depositfiles.com",
/http:\/\/depositfiles\.com/gi,
/Select your download mode|download the File|Free downloading mode|depositfiles\.com\/images\/speed_small\.gif|Eine Datei Runderladen|Download do arquivo|Datei Download|Скачивание файла|Descarga de archivo/gi,
/No such downlodable/gi,
/all downloading slots for your country/gi
]);
hosts.push (["duckload.com",
/http:\/\/duckload\.com/gi,
/Bitte Server/gi,
"",
""
]);
hosts.push (["easy-share.com",
/easy-share\.com/gi,
/FREE DOWNLOAD MODE|You are requesting/gi,
/requested File is deleted/gi,
""
]);
hosts.push (["egoshare.com",
/[\/.]egoshare\.com\//gi,
/You have requested/gi,
"",
""
]);
hosts.push (["enterupload.com",
/http:\/\/www\.enterupload\.com/gi,
/Download file/gi,
/could not be found/gi,
""
]);
hosts.push (["ezyfile.net",
/http:\/\/(www\.)*ezyfile\.net/gi,
/Download file/gi,
/no such file exist/gi,
""
]);
hosts.push (["fastfreefilehosting.com",
/http:\/\/fastfreefilehosting\.com/gi,
/File name:/gi,
/SNC000400\.jpg/gi,
""
]);
hosts.push (["file-rack.com",
/www.file\-rack\.com/gi,
/Downloads Process/gi,
"",
""
]);
hosts.push (["filebase.to",
/http:\/\/filebase\.to/gi,
/Der Download wird vorbereitet/gi,
"",
""
]);
hosts.push (["filebox.com",
/http:\/\/www\.filebox\.com/gi,
/download file|file_slot|splash_DownLoadBtn/gi,
"",
/filebox.com\/images\/folder\.gif/gi
]);
hosts.push (["filefactory.com",
/http:\/\/(www\.)*filefactory\.com/gi,
/Here are your download options|Download for free with FileFactory Basic|file uploaded/,
"",
""
]);
hosts.push (["fileflyer.com",
/www\.fileflyer\.com/gi,
/Download your files/gi,
"",
""
]);
hosts.push (["filesdump.com",
/filesdump\.com/gi,
/Download File/gi,
"",
""
]);
hosts.push (["fileshare.in.ua",
/fileshare\.in\.ua/gi,
/dnld_filename/gi,
"",
""
]);
hosts.push (["freakshare.net",
/http:\/\/freakshare\.net/gi,
/Premium Download/gi,
"",
""
]);
hosts.push (["filestock.ru",
/filestock\.ru/gi,
"",
/no such file/gi,
""
]);
hosts.push (["free-share.ru",
/http:\/\/free-share\.ru/gi,
"",
/404 Not Found/gi,
""
]);
hosts.push (["gigasize.com",
/www\.gigasize\.com/gi,
/class=\"dldcontent/gi,
"",
""
]);
hosts.push (["gigabyteupload.com",
/www\.gigabyteupload\.com/gi,
/watch online/gi,
/File is currently not available/gi,
""
]);
hosts.push (["gigeshare.com",
/www\.gigeshare\.com/gi,
/Date Uploaded:/gi,
"",
""
]);
hosts.push (["gotupload.com",
/www\.gotupload\.com/gi,
/download file/gi,
/file not found/gi,
""
]);
hosts.push (["hellshare.hu",
/http:\/\/download.hellshare.hu/gi,
/Free Download|következo mappát választotta/gi,
/fájl nem található/gi,
""
]);
hosts.push (["hotfile.com",
/http:\/\/hotfile\.com/gi,
/downloading|regular download|high speed download/gi,
"",
/\/i\/folder\.gif/gi
]);
hosts.push (["ifile.it",
/http:\/\/ifile\.it/gi,
/request download ticket/gi,
"",
""
]);
hosts.push (["infinitemb.com",
/http:\/\/www\.infinitemb\.com/gi,
/(download|stream)\.gif/gi,
"",
""
]);
hosts.push (["kewlshare.com",
/kewlshare\.com/gi,
/file name \:/gi,
"",
""
]);
hosts.push (["letitbit.net",
/letitbit\.net/gi,
/download3\.php/gi,
"",
""
]);
hosts.push (["load.to",
/http:\/\/www.load\.to/gi,
/You are going to download/gi,
/Please check URL/gi,
""
]);
hosts.push (["mediafire.com",
/www\.mediafire\.com/gi,
/You requested:|class=\"download_link\"/gi,
/media fire is the simplest/gi,
/myfiles_container/gi
]);
hosts.push (["megaftp.com",
/www\.megaftp\.com/gi,
/\"name_cont_1\"/gi,
"",
""
]);
hosts.push (["megashare.com",
/http:\/\/www\.megashare\.com/gi,
/Select your download|Download Your File/gi,
"",
""
]);
hosts.push (["megashares.com",
/megashares\.com/gi,
/Your Download Passport is|enter the passport/gi,
"",
""
]);
hosts.push (["megaupload.com",
/http:\/\/(www\.)*megaupload\.com/gi,
/\/gui\/c_dnl\.gif|gui\/c_dnl\.swf|gui\/h\_folders\.gif|name\=\"imagestring\"|but_dnld_file_o.gif|uploaded with File Uploader/gi,
"",
/wwwstatic\.megaupload\.com\/gui2\/h_ff\.gif/gi
]);
hosts.push (["megavideo.com",
/http:\/\/www\.megavideo\.com/gi,
/id=\"playertd\"/gi,
"",
/being converted/gi
]);
hosts.push (["multiup.org",
/http:\/\/multiup\.org/gi,
"",
/does not exist/gi,
/file download/gi
]);
hosts.push (["multiupload.com",
/http:\/\/multiupload\.com/gi,
"",
"",
/downloadbutton_/gi
]);
hosts.push (["netfolder.in",
/\/netfolder\.in/gi,
"",
"",
/Bisherige Dateien im Ordner/gi
]);
hosts.push (["netload.in",
/(www\.)*netload\.in/gi,
/file download/gi,
/we don\'t host/gi,
""
]);
hosts.push (["qubefiles.com",
/http:\/\/qubefiles\.com/gi,
/file size:/gi,
"",
""
]);
hosts.push (["quickupload.net",
/http:\/\/quickupload\.net/gi,
/download file/gi,
"",
""
]);
hosts.push (["rapidfolder.com",
/http:\/\/rapidfolder\.com/gi,
"",
"",
/\/download\.php/gi
]);
hosts.push (["rapidshare folders",
/http:\/\/rapidshare\.com\/users/gi,
/The LinkList has been created/gi,
"",
"",
]);
hosts.push (["rapidshare.com",
/http:\/\/rapidshare\.com\/files/gi,
"",
"",
""
]);
hosts.push (["rapidshare.de",
/http:\/\/rapidshare\.de/gi,
/Choose download-type/,
"",
""
]);
hosts.push (["rapidshare.ru",
/rapidshare\.ru/gi,
"",
/Файл был удален|file was deleted/gi,
""
]);
hosts.push (["rapidspread.com",
/http\:\/\/www\.rapidspread\.com/,
/You have requested the file:/gi,
"",
""
]);
hosts.push (["rokzoo.com",
/http:\/\/www\.rokzoo\.com/gi,
"",
/page not found/gi,
""
]);
hosts.push (["saveqube.com",
/saveqube\.com/gi,
/strong class=\"file/gi,
"",
""
]);
hosts.push (["sendfile.to",
/http:\/\/www\.sendfile\.to/gi,
/You have requested/gi,
"",
""
]);
hosts.push (["sendspace.com",
/http:\/\/www\.sendspace\.com/gi,
/Download Link:/gi,
"",
""
]);
hosts.push (["share-online.biz",
/share-online\.biz/gi,
/file name:/gi,
"",
""
]);
hosts.push (["shareator.com",
/http:\/\/shareator\.com/gi,
"",
/no such file exist/gi,
""
]);
hosts.push (["sharingmatrix.com",
/http:\/\/sharingmatrix\.com/gi,
/Select your download mode/gi,
"",
""
]);
hosts.push (["sharebase.to",
/http:\/\/sharebase\.to/gi,
/Last Download/gi,
"",
""
]);
hosts.push (["slingfile.com",
/http:\/\/www\.slingfile\.com/gi,
/file name:/gi,
"",
""
]);
hosts.push (["storage.to",
/http:\/\/(www\.)*storage\.to/gi,
/Download Type/gi,
/File not found/gi,
""
]);
hosts.push (["teradepot.com",
/http:\/\/www\.teradepot\.com/gi,
/download_submit_buttons/gi,
"",
""
]);
hosts.push (["turbobit.net",
/http:\/\/turbobit\.net/gi,
/download-file/gi,
"",
""
]);
hosts.push (["ugotfile.com",
/http:\/\/ugotfile\.com/gi,
/Forum Code|Verify Captcha|class=\"ugfCaptcha\"/gi,
/FileId and filename mismatched/,
""
]);
hosts.push (["up-file.com",
/http:\/\/up-file.com/gi,
/Download the file/gi,
"",
""
]);
hosts.push (["uploadbox.com",
/http:\/\/uploadbox.com/gi,
/Download as Premium|Premium Download|File name:/gi,
"",
""
]);
hosts.push (["uploaded.to",
/http:\/\/uploaded\.to/gi,
/Premium Download/gi,
/File doesn\'t exist|The file status can only be queried by premium users/gi,
""
]);
hosts.push (["uploading.com",
/http:\/\/(www\.)*uploading\.com/gi,
/File download|file size:|is already downloading|Free Download/gi,
"",
/Service Not Available/gi
]);
hosts.push (["uploadline.com",
/http:\/\/www\.uploadline\.com/gi,
/You have requested/gi,
/No such file/gi,
""
]);
hosts.push (["usershare.net",
/http:\/\/usershare\.net/gi,
/filename:/gi,
"",
""
]);
hosts.push (["vip-file.com",
/http:\/\/vip-file\.com/gi,
/File Name:/gi,
"",
""
]);
hosts.push (["ziddu.com",
/www\.ziddu\.com\/download/gi,
/\/images\/download-download-img\.gif|downloadfilelinkicon/gi,
"",
""
]);
hosts.push (["zshare.net",
/zshare\.net/gi,
/last download/gi,
/file not found/gi,
""
]);
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Regular expressions
////////////////////////////////////////////////////////////////////////////////////////////////////////
var all_rapidshare_regex = /(http\:|^.*?http:|^.*?http%3A)\/\/rapidshare\.com\/files\/\d{4,}\/.*?\..*?/gi;
var cavern_regex = /http:\/\/www\.thecavernforum/gi;
var imgs_regex = /http:\/\/127.0.0.1|http:\/\/www\.thecavernforum|IMAGESHACK\.US|PHOTOBUCKET\.COM|TINYPIC\.COM|WEBSHOTS\.COM|WWW\.PAYPAL\.COM/gi;
var img_exts_regex = /.gif|.jpg|.png/gi;
var redirs_regex = /http:\/\/BUX\.TO|KIJM7\.9HZ\.COM|LINK-PROTECTOR\.COM|LINKBUCKS\.COM|\/LINKIN\.US|\/LIX\.IN|PROTECTLINKS\.COM|RAPIDSAFE\.NET|RAPIDSHARR\.COM|TINYURL\.COM|URLHAWK|USERCASH\.COM|WLINK\.US\.COM|http:\/\/UL\.TO|http:\/\/sn\.im|http:\/\/adf\.ly|www\.seriousfiles\.com|\/\/snipr\.com|thatsprime\.com\//gi;
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Inline Images + GM Styles
////////////////////////////////////////////////////////////////////////////////////////////////////////
dead_png = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AMJCQkjdGXwDAAAAcpJREFUeNptkj9PFHEQhp/ZBcIhxyKHYgNCYUxogE0OpdDGxsQCY6e5ggS1Mn4Ce621u7MCYqOdX4DkSLTBqwyNiQmJBiJiDjmWP/ub1+IAMXGqmTx5M5nJY5wpwRiQHPfoL2rG8PVksDOBlKRYZWgwxcwkIQlc0o+fDe3sPu6E1dOQIGWg/yUT4zOUBiLtHYAHFBy6YvRrW+Hzl4/e/P2kAJ8iwRhJscrE+AzDwxG3Z2E/oO9bKMvhzj104aLZ1dFr9PZUWzDWASQMDaYqDZjdvAWzd2HkMlpcJKpUsMlJdHiI3i1Ffr4v9d29pEMnt7UyfOkNNjKKTU8Tl8tghq+sEGqvUZwjZA5EAiShPIetLXxhASSIY3An1Gr4xkabq70iar9OkOeoWCSqVMAM8hzMiObnIUnQ0RFyR0DkgNylzhh7cB+bmsLrdQ7n5gj1OlG5TPxoHro7kUsC4mdQUB5u0NdziW/r5q2M/PkLfG2NsLwMkRHevyVkWQib26t+FJYMIIOUvt5XdmXkunXEke/sQchRCNDdRfAQ8vXND97af1qCxqkRLUj9XKFq/cUUMMmRQHKFZquh7OBhCRr/aATQ/I97foxKZ9z7A9QA5voyr3dtAAAAAElFTkSuQmCC';
live_png = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy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z3DjGj5qLl4ubZ/Fwk3WxgQe+A4gWfDGzsooErxCikGCTkC7HeYeTLvxJgdpdaHv2m3haab/V0zfehPq8c8GIVz1MuiVA+nvycpLJD2Q2L56xhzw5ZUu5nhRm3xHuBpFXidlRpLkQk/VrnY0Ssewzsl3VexR07e81rWGtPd5P8brl4S1pGBp33y251MxLWsNaav/wG6GRXYoAbWagAAAABJRU5ErkJggg=='
if (pref2 != true){pref3 = pref4 = pref7 = ""};
GM_addStyle("#live_link {background:" + pref3 + " url("+live_png+") no-repeat scroll 100% 50%;padding-right:17px;}");
GM_addStyle("#dead_link {background:" + pref4 + " url("+dead_png+") no-repeat scroll 100% 50%;padding-right:17px;}");
GM_addStyle("#mayb_link {background:" + pref7 + " url("+mayb_png+") no-repeat scroll 100% 50%;padding-right:17px;}");
GM_addStyle("#redr_link {background:" + pref4 + " url("+redr_png+") no-repeat scroll 100% 50%;padding-right:65px;}");
GM_addStyle("#ok_img_link {background:" + pref3 + " url("+ok_img_png+") no-repeat scroll 100% 50%;padding-right:120px;}");
GM_addStyle("#bad_img_link {background:" + pref4 + " url("+bad_img_png+") no-repeat scroll 100% 50%;padding-right:95px;}");
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Setup menu for TCLC preferences
////////////////////////////////////////////////////////////////////////////////////////////////////////
GM_registerMenuCommand("TCLC Preferences", show_prefs);
var div_prefs = document.createElement('div_prefs');
document.body.appendChild(div_prefs);
div_prefs.id = "div_prefs";
//Functions
function chk(ck){
return (ck == true)?("checked"):("");
}
function get_hosts(){
//GM_setValue("tclc_hosts_enabled", "");
GMHosts = GM_getValue("tclc_hosts_enabled","");
if (GMHosts == ""){
for (var ii = 0; ii < hosts.length; ii++){
var host = hosts[ii][0];
GMHosts = GMHosts + host + "|"; //For some reason GMHosts is too large (902)!!!!!
}
GM_setValue("tclc_hosts_enabled", GMHosts);
}
}
function update_prefs(){
GM_setValue("tclc_p1", document.getElementById('p1').checked);
GM_setValue("tclc_p2", document.getElementById('p2').checked);
GM_setValue("tclc_p3", document.getElementById('p3').value);
GM_setValue("tclc_p4", document.getElementById('p4').value);
GM_setValue("tclc_p5", document.getElementById('p5').checked);
GM_setValue("tclc_p6", document.getElementById('p6').checked);
GM_setValue("tclc_p7", document.getElementById('p7').value);
GM_setValue("tclc_p8", document.getElementById('p8').checked);
window.location.reload();
}
function host_enable(){
var host = document.getElementById('list_available').options[document.getElementById('list_available').selectedIndex].text;
var key = GM_getValue("tclc_hosts_enabled", "");
if (key == ""){
GM_setValue("tclc_hosts_enabled", host + "|");
GMHosts = GMHosts + host + "|";
} else {
GM_setValue("tclc_hosts_enabled", key + host + "|");
GMHosts = key + host + "|";
}
show_prefs()
}
function host_disable(){
var old_hosts = GM_getValue("tclc_hosts_enabled", "");
var selHost = document.getElementById('list_enabled').options[document.getElementById('list_enabled').selectedIndex].text;
var new_hosts = "";
var hostArray = old_hosts.split('|');
for (var key in hostArray) {
var aHost = hostArray[key];
if (aHost != selHost){
new_hosts = new_hosts + aHost + "|";
}
}
GM_setValue("tclc_hosts_enabled", new_hosts);
GMHosts = new_hosts;
show_prefs()
}
function show_prefs(){
var t = new Array();
var divL = (innerWidth - 720).toString();
var divT = (innerHeight - 600).toString();
var pref3 = GM_getValue("tclc_p3", ""); if(pref3 == ""){pref3 = "paleGreen"};
var pref4 = GM_getValue("tclc_p4", ""); if(pref4 == ""){pref4 = "lightPink"};
var pref7 = GM_getValue("tclc_p7", ""); if(pref7 == ""){pref7 = "yellow"};
t.push('<div id="prefs_html" style = "position: fixed; top:' + divT + 'px; left:' + divL + 'px; width:700px; background-color: #EEEEEE;" >');
t.push(' <table border=2 cellspacing=0 width=700px><tr><td><center><b>The Cavern Links Checker Preferences<b></center></td><td valign=top><center><button id="tclc_close_prefs" type="button" onClick="update_prefs()"><font size=-2><b>X</b></font></button></center></td></tr></table>');
t.push(' <table border=2 cellspacing=0>');
t.push(' <tr>');
t.push(' <td width=175px>');
t.push(' <center><b>Enabled Hosts</b><br>');
t.push(' <select id="list_enabled" name="list_enabled" size=15>');
for (var ii = 0; ii < hosts.length; ii++){
var host = hosts[ii][0];
if (GMHosts.indexOf(host + "|") != -1){
t.push(' <option value="' + host + '">' + host + '</option>');
}
}
t.push(' </select><br>');
t.push(' <button id="tclc_host_disable" type="button" onClick="host_disable()">Disable Host</button></center>');
t.push(' </td><td width=175px>');
t.push(' <center><b>Available Hosts</b><br>');
t.push(' <select id="list_available" name="list_available" size=15>');
for (var ii = 0; ii < hosts.length; ii++){
var host = hosts[ii][0];
if (GMHosts.indexOf(host + "|") == -1){
t.push(' <option value="' + host + '">' + host + '</option>');
} else {
}
}
t.push(' </select><br>');
t.push(' <button id="tclc_host_enable" type="button" onClick="host_enable()">Enable Host</button></center>');
t.push(' </td><td width=350px>');
t.push(' <table border=0 cellpadding=0 cellspacing=0 >');
t.push(' <tr align=left><td><font size=1><b> Enable Linkify</td><td><input type="checkbox" name="p1" id="p1" ' + chk(pref1) + '></b></font></td>');
t.push(' <tr align=left><td><font size=1><b> Highlight Full Link</td><td><input type="checkbox" name="p2" id="p2" ' + chk(pref2) + '></b></font></td>');
t.push(' <tr align=left><td><font size=1><b> Good Link Color</td><td><input type="text" name="p3" id="p3" value=' + pref3 + '></b></font></td>');
t.push(' <tr align=left><td><font size=1><b> Bad Link Color</td><td><input type="text" name="p4" id="p4" value=' + pref4 + '></b></font></td>');
t.push(' <tr align=left><td><font size=1><b> Maybe Link Color</td><td><input type="text" name="p7" id="p7" value=' + pref7 + '></b></font></td>');
t.push(' <tr align=left><td><font size=1><b> Check bad image hosts</td><td><input type="checkbox" name="p5" id="p5" ' + chk(pref5) + '></b></font></td>');
t.push(' <tr align=left><td><font size=1><b> Check for Redirectors</td><td><input type="checkbox" name="p6" id="p6" ' + chk(pref6) + '></b></font></td>');
t.push(' <tr align=left><td><font size=1><b> MouseOver Mode</td><td><input type="checkbox" name="p8" id="p8" ' + chk(pref8) + '></b></font></td>');
t.push(' <tr></tr>');
t.push(' </table>');
t.push(' </td>');
t.push(' </tr>');
t.push(' </table>');
t.push('</div>');
div_prefs.innerHTML = t.join('\n');
var btn_close = document.getElementById("tclc_close_prefs");
btn_close.addEventListener("click", update_prefs, false);
var btn_host_enable = document.getElementById("tclc_host_enable");
btn_host_enable.addEventListener("click", host_enable, false);
var btn_host_disable = document.getElementById("tclc_host_disable");
btn_host_disable.addEventListener("click", host_disable, false);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Process links
////////////////////////////////////////////////////////////////////////////////////////////////////////
if (pref1 == true)(linkify());
var GMHosts = GM_getValue("tclc_hosts_enabled");
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++){
var urll = links[i].href;
count = count + 1;
urll = urll.replace(/%2F/gi,'/');
urll = urll.replace(/%3A/gi,':');
//urll = urll.replace(/\?killcode=[\d]*/gi,'');
//Check for a valid image link
if (urll.substr(-4).search(img_exts_regex) != -1){ //Image links
if (pref5 == true && document.URL.search(cavern_regex) != -1){
if (links[i].href.search(imgs_regex) != -1) {
links[i].id = 'ok_img_link';
} else {
links[i].id = 'bad_img_link';
}
}
} else if (links[i].href.search(redirs_regex) != -1){ //Redirector links
if (pref6 == true){links[i].id = "redr_link"};
} else {
if (pref8){links[i].addEventListener("mouseover", MouseOver, false)};
//Rapidshare file links
if (links[i].href.search(all_rapidshare_regex) != -1){
links[i].id = "a" + count;
var urll = links[i].href;
numberofrslinks++;
var myString = ''+numberofrslinks+'';
if (myString.search(/\d00/) != -1){
rs_links.push('>>split<<');
}
rs_links.push(urll);
} else {
//Other File Links
for (var ii = 0; ii < hosts.length; ii++){ //Slightly inefficient. Should only address enabled hosts.
if (links[i].href.search(hosts[ii][1]) != -1) { // Could join hosts array but then not sure how to get index
if (GMHosts.indexOf(hosts[ii][0] + "|") != -1){ // for alive/dead/maybe regexs.???
links[i].id = "a" + count;
other_links.push(links[i]);
other_link_qty = other_link_qty + 1;
other_alive.push(hosts[ii][2]);
other_dead.push(hosts[ii][3]);
other_maybe.push(hosts[ii][4]);
}
}
}
}
}
}
if (pref8){
//Do Nothing
} else {
rs_links = rs_links.join();
rs_links = rs_links.replace(/,/gi,'\n');
var rs_links = rs_links.split(">>split<<");
if (rs_links.length > 0){rs_link_check(rs_links)};
if (other_links.length > 0){other_link_check(other_links)};
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Image filter
////////////////////////////////////////////////////////////////////////////////////////////////////////
if (flag_cavern == true){
var found = 0;
var imgs = document.getElementsByTagName('img');
for (var i = 0; i < imgs.length; i++) {
var img = imgs[i].src;
if (pref5 == true && img.search(imgs_regex) == -1) {
found = 1;
var p = document.createElement('p');
p.innerHTML = "<div><img src='" + imgs[i].src + "' height=50px width=50px> " + imgs[i].src + ' <b><font size=+1>= Unapproved Image Host</font></b></div>';
p.style.backgroundColor = pref4;
imgs[i].parentNode.insertBefore(p, imgs[i].nextSibling);
imgs[i].parentNode.removeChild(imgs[i]);
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Functions
////////////////////////////////////////////////////////////////////////////////////////////////////////
function MouseOver(){
other_alive = [];
other_dead = [];
other_maybe = [];
other_link_qty = 0;
other_links = [];
rs_links = [];
if (this.href.search(all_rapidshare_regex) != -1){
rs_links.push(this.href);
} else {
for (var ii = 0; ii < hosts.length; ii++){ //Slightly inefficient. Should only address enabled hosts.
if (this.href.search(hosts[ii][1]) != -1) { // Could join hosts array but then not sure how to get index
if (GMHosts.indexOf(hosts[ii][0] + "|") != -1){ // for alive/dead/maybe regexs.???
other_links.push(this);
other_link_qty = other_link_qty + 1;
other_alive.push(hosts[ii][2]);
other_dead.push(hosts[ii][3]);
other_maybe.push(hosts[ii][4]);
}
}
}
}
if (rs_links.length > 0){rs_link_check(rs_links)};
if (other_links.length > 0){other_link_check(other_links)};
}
function rs_link_check(rs_links){
if (GMHosts.indexOf("rapidshare.com|") != -1){
for (var i = rs_links.length - 1; i >= 0; i--) {
GM_xmlhttpRequest({
method: "POST",
url: 'http://rapidshare.com/cgi-bin/checkfiles.cgi',
headers:{'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey', 'Content-type':'application/x-www-form-urlencoded'},
data:'urls='+encodeURIComponent(rs_links[i]),
onload:function(result) {
res=result.responseText;
notfound = res.match(/inexistent<\/td><\/tr><\/table> \n<div class="downloadlink">http:\/\/rapidshare\.com\/files\/(\d*)\/.*<\/div>/g);
livelink = res.match(/load<\/a><\/td><\/tr><\/table> \n<div class="downloadlink">http:\/\/rapidshare\.com\/files\/(\d*)\/.*<\/div>/g);
if (notfound){
var notfoundlinks = new Array();
for (var i = notfound.length - 1; i >= 0; i--) {
var string=notfound[i];
var regex = /inexistent<\/td><\/tr><\/table> \n<div class="downloadlink">http:\/\/rapidshare\.com\/files\/(\d*)\/.*<\/div>/;
matchArray=string.match(regex);
notfoundlinks.push(matchArray[1]);
}
if (notfoundlinks){
DiplayTheDeletedLinks(notfoundlinks);
}
}
if (livelink){
var livelinklinks = new Array();
for (var i = livelink.length - 1; i >= 0; i--) {
var string=livelink[i];
var regex2 = /load<\/a><\/td><\/tr><\/table> \n<div class="downloadlink">http:\/\/rapidshare\.com\/files\/(\d*)\/.*<\/div>/;
matchArraylive=string.match(regex2);
livelinklinks.push(matchArraylive[1]);
}
if (livelinklinks){
DiplayTheLiveLinks(livelinklinks);
}
}
}
});
}
rs_links = null;
}
}
function DiplayTheDeletedLinks(notfoundlinks){
var xpathofnotfoundlinks = "//a[contains(@href,\'" + notfoundlinks.join('\') or contains(@href,\'') +"\')]";
var allLinks, thisLink;
allLinks = document.evaluate( xpathofnotfoundlinks, document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < allLinks.snapshotLength; i++) {
var thisLink = allLinks.snapshotItem(i);
thisLink.id = 'dead_link';
}
}
function DiplayTheLiveLinks(livelinklinks){
var xpathoflivelinklinks = "//a[contains(@href,\'" + livelinklinks.join('\') or contains(@href,\'') +"\')]";
var allliveLinks, thisLink;
allliveLinks = document.evaluate( xpathoflivelinklinks, document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < allliveLinks.snapshotLength; i++) {
var thisLink = allliveLinks.snapshotItem(i);
thisLink.id = 'live_link';
}
}
function other_link_check(other_links){
for (var i = 0; i < other_links.length; i++){
var file_is_alive = other_alive[i];
var file_is_dead = other_dead[i];
var file_is_maybe = other_maybe[i];
var URL = other_links[i].href;
var URLid = other_links[i].id;
var ret = other_get_url(URL, URLid, file_is_alive, file_is_dead, file_is_maybe);
}
other_links = null;
}
function other_get_url(URL, URLid, file_is_alive, file_is_dead, file_is_maybe){
//When method was POST, some checks were invalid. They seemed to come back blank.
GM_xmlhttpRequest({
method: 'GET',
url: URL,
headers: { 'User-agent': 'Mozilla/4.0 [en] (Windows NT 6.0; U)', },
onload: function(responseDetails) {
if (responseDetails.responseText.search(file_is_dead) > 0){
document.getElementById(URLid).id = 'dead_link';
} else if (responseDetails.responseText.search(file_is_alive) > 0){
document.getElementById(URLid).id = 'live_link';
} else if (responseDetails.responseText.search(file_is_maybe) > 0){
document.getElementById(URLid).id = 'mayb_link';
} else { //Unknown link
document.getElementById(URLid).id = 'dead_link';
}
}
});
}
function linkify(){
try{
var regex = /((?:https?|ftp):\/\/[^\s'"'<>()]*|[-\w.+]+@(?:[-\w]+\.)+[\w]{2,6})/gi;
var regex_exclude_html_trunc = /http:\/\/uploading\.com|http:\/\/letitbit.net|http:\/\/www\.gshare\.com|http:\/\/netload\.in/gi;
var regex_ends = /\.rar\.html\b/gi;
var mail_addr = /\@/;
var altText, txt, muligtLink;
//var OKTags = ['a', 'head', 'script', 'style', 'textarea', 'title', 'option', 'pre', 'code']; //Removed to show links in code,pre,textarea blocks
var OKTags = ['a', 'head', 'script', 'style', 'title', 'option', 'textarea'];
var path = "//text()[not(parent::" + OKTags.join(" or parent::") +")]";
altText = document.evaluate(path, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0;i<altText.snapshotLength;i++){
txt = altText.snapshotItem(i);
muligtLink = txt.nodeValue;
if(regex.test(muligtLink)){
var span = document.createElement('span');
var lastLastIndex = 0;
regex.lastIndex = 0;
for(myArray = null; myArray = regex.exec(muligtLink); ){
var link = myArray[0];
if (mail_addr.test(link)){0
//Do Nothing
} else {
span.appendChild(document.createTextNode(muligtLink.substring(lastLastIndex, myArray.index)));
var href = link;
var prefix = '';
if(href.length > 7){
prefix = href.substring(0,7);
if(prefix.toLowerCase() != 'http://' && prefix.toLowerCase() != 'https:/'){
href = 'http://' + href;
}
}
//Fix links that end in .rar.html
if (href.search(regex_exclude_html_trunc) == -1){
if (href.search(regex_ends) != -1){
href = href.substr(0, href.length - 5);
}
}
var a = document.createElement('a');
a.setAttribute('href', href);
var orig_href = href;
a.appendChild(document.createTextNode(href));
span.appendChild(a);
lastLastIndex = regex.lastIndex;
}
}
span.appendChild(document.createTextNode(muligtLink.substring(lastLastIndex)));
txt.parentNode.replaceChild(span, txt);
}
}
} catch(e){alert(e);}
}
