Forum Deblocker

By hosts Last update Mar 23, 2009 — Installed 2,569 times. Daily Installs: 12, 19, 13, 13, 12, 9, 12, 14, 13, 9, 19, 16, 16, 12, 17, 8, 11, 13, 16, 10, 5, 7, 7, 21, 12, 10, 6, 8, 10, 14, 19, 12
// ==UserScript==
// @name           Forum Deblocker
// @namespace      --------------
// @description    The "Forum Deblocker" userscript simulates the Googlebot so you may see the forum pages as google sees them
// @include        http://*/forum/*
// @include        http://*/forums/*
// @include        http://*showtopic*
// @include        http://*topic-t*
// @include        http://*viewtopic*
// @include        http://*showforum*
// @include        http://*showthread.php*
// @version        20090321
// ==/UserScript==


var divElement;
divElement = document.evaluate("//body",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;

xx = divElement.innerHTML;

var myregexp = new RegExp("(You are not logged in)|(not have the required permissions)|(Lütfen aşağıdan giriş)|(Se non sei connesso al forum utilizza)|(prijaviti, moraš se registrirati)|(Registrace trvá jen pár vteřin)|(olmak için Tıklayınız)|(you to be registered and logged in)|(Você não está logado)|(are not logged in)|(Please login)|(aşağıdaki formu kullanarak giriş yapınız)|(The error returned was)");

if (xx.match(myregexp)) {

//GM_log('xx1');
     GM_xmlhttpRequest({
     method: "get",
     url: location.href,
     overrideMimeType: 'text/html; charset=' + document.characterSet,
    headers:{'User-agent': 'Googlebot/2.1 (+http://www.google.com/bot.html)'},
            // 'Content-type':'application/x-www-form-urlencoded'},       
     onload:function(result) {
//GM_log('xx2');
     	if (result.responseText.match(myregexp)){return;}
     	else{
   divElement.innerHTML += "<!-- starting --><hr/>"+
   "<div style='background:red;font-size:19px;'>Forum Deblocked</div><hr/>"+
   result.responseText+"<!-- ending -->";     	
  
  }
     	}});

	}
	
	//GM_xmlhttpRequest User-agent Content-type