Mental's Host Checker for planetsuzy.org

Marks allowed & banned image & file hosts on planetsuzy.org

La data de 08-11-2015. Vezi ultima versiune.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

//added abload.de & fireimg.net to redirect hosts
// ==UserScript==
// @name           Mental's Host Checker for planetsuzy.org
// @version        70.87
// @namespace      mental
// @description    Marks allowed & banned image & file hosts on planetsuzy.org
// @license	   GPL version 3 or any later version (http://www.gnu.org/copyleft/gpl.html)
// @include        http://planetsuzy.org/*
// @include        http://*.planetsuzy.org/*
// @grant          none
// @icon           http://sharenxs.com/photos/2013/10/10/52563781d358c/nxs-psl.jpg
// @homepage        http://www.mentalps.5gbfree.com
// ==/UserScript==

(function() { 
'use strict';

if (window.self !== window.top) { return; } // end execution if in a frame

// List Of Allowed Image Hosts & Links
var imgHosts = [
  '.fscache.com',
  'depic.me',
  'dodaj.rs',
  'egafd.com',
  'gfycat.com',
  'iafd.com',
  'imagebam.com',
  'imageho.me',
  'imagetwist.com',
  'imageupper.com',
  'imagevenue.com',
  'imagezilla.net',
  'imdb.com',
  'imgbox.com',
  'photosex.biz',
  'pics-hosting.com',
  'pics-sharing.net',
  'picstate.com',
  'picszone.net',
  'pimpandhost.com',
  'pixelup.net',
  'pixhost.org',
  'pixroute.com',
  'postimage.org',
  'postimg.org',
  'postxxximage.org',
  'sharenxs.com',
  'someimage.com',
  'stooorage.com',
  'turboimagehost.com',
  'uploadhouse.com',
  'winimg.com', 

];

// List Of Allowed File Hosts
var fileHosts = [ 
  '1fichier.com',
  'warlc.5gbfree.com',
  'adlink.wf',
  'anonym.to',
  'click.tf',
  'CloudZilla.to',
  'datafile.com',
  'depfile.com',
  'depositfiles.com',
  'depositfiles.org',
  'depositstorage.com',
  'dfiles.eu',
  'dfiles.ru',
  'fboom.me',
  'fileboom.me',
  'filedrive.com',
  'filefactory.com',
  'FileJoker.net',
  'filepost.com',
  'fritchy.com',
  'fp.io',
  'hugefiles.net',
  'k2s.cc',
  'keep2s.cc',
  'keep2share.cc',
  'keep2share.com',
  'kyc.pm',
  'lan.wf',
  'led.wf',
  'mega.co',
  'mega.nz',
  'mentalps.5gbfree.com',
  'Neodrive.co',
  'planetsuzy.org',
  'ps.fscache.com',
  'rapidgator.net',
  'Rapidsonic.com',
  'rg.to',
  'Solidfiles.com',
  'ssh.tf',
  'ssh.yt',
  'ul.to',
  'uploadable.ch',
  'uploaded.net',
  'uploaded.to',
  'Uploadrocket.net',
  'upsto.re',
  'Upstore.net',
  'yep.pm',
  'zippyshare.com',

];

// redirect image hosts
var redirect_hosts = [
  '37v.net',
  'abload.de',
  'adultsimage.com',
  'anonpics.com',
  'binimage.org',
  'http://blogspot.com',   
  'buspic.com',
  'casimages.com',
  'casinimages.com',
  'cloudimg.net',
  'damimage.com',
  'dimtus.com',
  'directupload.net',
  'dumparump.com',
  'dumppix.com',
  'easyimghost.com',
  'ericsony.com',
  'famouscelebritiespictures.com',
  'fapoff.com',
  'fapomatic.com',
  'fastpic.ru',
  'filefap.com', 
  'fileshared.net',
  'fireimg.net',
  'fotoupload.ru',
  'free-image-hosting.com',
  'freeimage.us',
  'freeimagehosting.net',
  'galleries.bz',
  'gasica77pornpp.com',
  'girlscanner.com',
  'gokoimage.com',
  'hizliresim.com',
  'hostimage.ru',
  'hostingfailov.com',
  'hostingpics.net',
  'hostmypixxx.org',
  'hosturimage.com',
  'hotchyx.com',
  'hotimg.com',
  'hqpictures.org',
  'hybridupload.com',
  'image2share.net',
  'image2you.ru',
  'image-boom.com',
  'image-hoster.de',
  'imageban.net',
  'imageban.ru',
  'imagebanana.com',
  'imagebax.com',
  'imagebin.org',
  'imagebunk.com',
  'imagecarry.com',
  'imagecherry.com',
  'imagecorn.com',
  'imagecurl.org',
  'imagedax.net',
  'imageeer.com',
  'imagefast.org',
  'imagefolks.com',
  'imagehaven.net',
  'imageheli.com',
  'imagehousing.com',
  'imagejumbo.com',
  'imagelink.cz',
  'imagelook.org',
  'imagenimage.com',
  'imagenpic.com',
  'imagepicsa.com',
  'imagepix.org',
  'imageporter.com',
  'imagesadda.com',
  'imagescream.com',
  'imageshost.ru',
  'imageshack.com',
  'imageshimage.com',
  'imagesion.com',
  'imagesious.com',
  'imagesist.com',
  'imagesplace.net',
  'imagespot.org',
  'imageteam.org',
  'imagewaste.com',
  'imagik.fr',
  'imgadult.com',
  'imgah.com',
  'imgbabes.com',
  'imgbar.net',
  'imgbd.net',
  'imgcandy.net',
  'imgchili.com',
  'imgchili.net',
  'imgcloud.co',
  'imgcorn.com',
  'imgdino.com',
  'imgdollar.com',
  'imgearn.net',
  'imgearner.com',
  'imgelite.com',
  'imgempire.com',
  'imgfap.net',
  'imgfest.com',
  'imgflare.com',
  'imggoo.com',
  'imghaven.com',
  'imgheat.com',
  'imghosting.cz',
  'imgim.com',
  'imgimg.de',
  'imgko.com',
  'imgmad.com',
  'imgmaster.net',
  'imgmega.com',
  'imgmoney.com',
  'imgnext.com',
  'imgpapa.com',
  'imgpaying.com',
  'imgphun.com',
  'imgpo.st',
  'imgpony.com',
  'imgrex.com',
  'imgrill.com',
  'imgserve.net',
  'imgshow.com',
  'imgspice.com',
  'imgsure.com',
  'imgtab.net', 
  'imgtiger.com',
  'imgtrick.com',
  'imgur.com',
  'kepfeltoltes.hu',
  'kiwi.com',
  'linkbucks.com',
  'lostpic.net',
  'minus.com',
  'miragepics.com',
  'moneyplatform.biz',
  'nudeimagehost.com',
  'nudeshare.com',
  'paidimg.com',
  'passpix.com',
  'photobucket.com',
  'photoearn.com',
  'phototo.org',
  'pic2profit.com',
  'pic4you.ru',
  'pic5you.ru',
  'pic-upload.de',
  'picage.ru',
  'picbucks.com',
  'piccash.net',
  'piclambo.net',
  'piclead.com',
  'picload.org',
  'picp2.com',
  'picsee.net',
  'picsious.com',
  'picthost.net',
  'pictr.com',
  'pictures.se',
  'picturesion.com',
  'picturescream.com',
  'pixhost.biz',
  'pixhub.eu',
  'pixic.ru',
  'pixpal.net',
  'pixtreat.com',
  'pixup.us',
  'posteram.ru',
  'premiumpics.net',
  'pzy.be',
  'qrrro.com',
  'radikal.ru',
  'sexfetishforum.com',
  'sexyimg.com',
  'shotimg.net',
  'shotpix.com',
  'sleekpix.com',
  'spetson.com',
  'storeimgs.net',
  'subirimagenes.com',
  'subirporno.com',
  'swagirl.com',
  'sxpics.nl',
  'teenvideomegathread.com',
  'threepicture.com',
  'thumbhost.eu',
  'tinyuploads.com',
  'tnabucks.com',
  'tuspic.net',
  'ultraimg.com',
  'up4.upppic.com',
  'uploadbox.com',
  'uploadedimg.com',
  'uploadyourimages.org',
  'upix.me',
  'uppix.net',
  'vavvi.com',
  'viewcube.org',
  'wayupload.com',
  'wewpic.com',
  'winimg.com',
  'xlocker.net',
  'xxxupload.org',
  'zooomimg.com',
];

// List Of Mirror File Hosts
var mirHosts = [
'rapidgator.net',
'rg.to',
'ul.to',
'uploaded.net',
'uploaded.to',
];

var Allowed = new RegExp (imgHosts.join('|').replace(/[*.]/g,'\\$&'), 'i');
var AllowedFile = new RegExp (fileHosts.join('|').replace(/[*.]/g,'\\$&'), 'i');
var hostredirect = new RegExp (redirect_hosts.join('|').replace(/[*.]/g,'\\$&'), 'i');
var hostmirror = new RegExp (mirHosts.join('|').replace(/[*.]/g,'\\$&'), 'i');

// set image border size, type, & color here
var allowedImgStyle = 'border: 5px solid #008000;';
var bannedImgStyle = 'border: 4px solid #FF0000;';

// set file border, background, size, type & color here
var allowedUrlStyle = 'border: 3px solid #008000;';
var bannedUrlStyle = 'border: 3px solid #FF0000;';
var redirectStyle = 'background-color: #FF0000; border: 3px solid #FF0000;';
var mirrorStyle = 'background-color: #DEB887; border: 3px solid #008000;';

var imgArray =[];
var hostArray = [];
var pat = /([^./]+\.[^./]+)|(\*+)(?=\/)/;
var local = location.hostname;
var localb = "ps.fscache.com";

// check all the images in the Post (not including the signature)
var img = document.querySelectorAll('[id^="post_message"] img');

for (var i = 0, len = img.length; i < len; i++) {
  
  var dom = img[i].src.match(pat)[0];
  if (local.indexOf(dom) !== -1) { continue; } // disregards links/Images from local domain
  
  
  if (localb.indexOf(dom) !== -1) { continue; } // disregards ps.fscache.com
  
  imgArray[dom] = 1; // cache for notice display
  
  img[i].setAttribute('title', img[i].src); // set the src to title for mouse-over display

  // set a style for allowed/unallowed Image hosts
  if (Allowed.test(img[i].src)<=0) {
    img[i].setAttribute('style', bannedImgStyle); //images not on the allowed list will get a red border
  }
  else if (Allowed.test(img[i].src)) {
    img[i].setAttribute('style', allowedImgStyle); //images on the allowed list will get a green border
  } 
}

//Mark url links
var urls = document.querySelectorAll('[id^="post_message"] a');

for (var i = 0, len = urls.length; i < len; i++) {

  var dom = urls[i].href.match(pat)[0];
  if (local.indexOf(dom) !== -1) { continue; } // disregards links/Images from local domain
  
  hostArray[dom] = 1; // cache for notice display
  
  if (AllowedFile.test(urls[i].href)<=0) {
    urls[i].setAttribute('style', bannedUrlStyle); // puts a red box around links on banned hosts
    }
  if (AllowedFile.test(urls[i].href)) {
    urls[i].setAttribute('style', allowedUrlStyle);  // puts a green box around links on allowed hosts
    }
  if (Allowed.test(urls[i].href)) {
    urls[i].setAttribute('style', allowedUrlStyle);  // puts a green underline on pics on allowed hosts
    }
  if (hostmirror.test(urls[i].href)) {
    urls[i].setAttribute('style', mirrorStyle);  // puts a shaded background on hosts that require mirror links
    
  } 
}

    //check for redirected images
var urls = document.querySelectorAll('[id^="post_message"] a');

for (var i = 0, len = urls.length; i < len; i++) {
  
  if (hostredirect.test(urls[i].href)) {
    urls[i].setAttribute('style', redirectStyle); // puts red underline under images redirecting to a banned image host

  } 
}

// mark URLs inside CODE tags
var pre = document.getElementsByTagName('pre');

if (pre[0]) {

  for (var i = 0, len = pre.length; i < len; i++) {
  
  hostArray[dom] = 1; // cache for notice display

    // replace HTML links with text links in pre tags
    var a = pre[i].getElementsByTagName('a');
    if (a[0]) { 
      
      for (var n = 0, len = a.length; n < len; n++) {
    
        console.log(a[0].href);
        a[n].parentNode.replaceChild(document.createTextNode(a[n].href), a[n]);
      }
    }
    
    
    // mark text links in pre tags
    pre[i].innerHTML = pre[i].innerHTML.replace(/https?:\/\/\S+/gi, function(m) { 
      if (AllowedFile.test(m)<=0) {
        return '<span style="' + bannedUrlStyle + '">' + m + '</span>'; //puts a red box around links on banned hosts that are posted inside code tags
      }
      if (hostmirror.test(m)) {
          return '<span style="' + mirrorStyle + '">' + m + '</span>';  // puts a shaded background on hosts that require mirror links that are posted inside code tags
        }
      else if (AllowedFile.test(m)) {
        return '<span style="' + allowedUrlStyle + '">' + m + '</span>';  //puts a green box around links on allowed hosts that are posted inside code tags
      }
      return m;
    });
  }
}

var td = document.querySelector('td.alt1:only-child[width="100%"]');
if (!td) { return; }

// adds a list of all image and file hosts used on the page at the top of the page
var span = document.createElement('span');
span.setAttribute('style', 'color: #008;');
span.innerHTML = '<br />' +
  '<b>Image & File Host Links Used On This Page:</b> ' + (Object.keys(hostArray).join(' | ') || 'n/a');
td.appendChild(span);

})();


var allowed_hosts = new  Array("fscache.com");
var images = document.getElementsByTagName('img');
var images_count = images.length;
var thumbnail;
allowed_hosts_count = allowed_hosts.length;
for(i = 0; i < images_count; i++){
	image = images[i];

	thumbnail = false; 

		var image_container = image.parentNode;
		
		if (image_container.localName == 'a')
		{ 
			thumbnail = true;
		for(j = 0; j < allowed_hosts_count; j++)
				if(image_container.href.indexOf(allowed_hosts[j]) >= 0) { 

				}
		} 

	if (thumbnail == false)
	{
		var toplevelnode = image.parentNode;
		var cur_id="";
		while (true)
		{
			cur_id=toplevelnode.id;
			if (cur_id.length>0)
			if (cur_id.indexOf('post_message_')>=0)
			{
				if(image.src.indexOf(allowed_hosts[0]) == -1)
				image.style.border = "thick solid purple"; 
				break; 
			} 
			if (toplevelnode.localName == 'body' || cur_id.indexOf('posts')>=0) break;
			toplevelnode = toplevelnode.parentNode; 
		}
	}
}