// ==UserScript==
// @name           Show robots meta
// @namespace      http://www.liamdelahunty.com/tips/greasemonkey.php
// @description    Show the nofollow status in the meta tag (if found). Based on Joost de Valk's script.
// @include        *
// @exclude        http://*.google.*
// @exclude        https://*.google.*
// @exclude        http://*.yahoo.*
// @exclude        https://*.yahoo.*
// @exclude        http://digg.com/*
// @exclude        http://*.stumbleupon.com/*
// @exclude        http://*.reddit.com/*
// ==/UserScript==

var	topdist = 0;

function printBox(id, message, url) {
	var d = document;
	var div = d.createElement("div");
	div.id = id;
	div.innerHTML = '<div style="position: absolute; left: 0px; top: '+ topdist +'px;' +
	'text-align: center; width: 200px; margin-bottom: 5px; z-index: 999; background-color: #00c; padding: 2px;">' +
	'<p style="margin: 2px 0; background-color: inherit;"> ' +
	'<a target="_blank" class="snap_nopreview" style="border-bottom: 1px solid #000; background-color: inherit; ' +
	'font: bold 10px Verdana; color: #fff; font-weight: bold;" href="http://'+document.location.hostname+'/robots.txt">'+message+'</a>' +
	'</p></div>';
	
	topdist = topdist + 20;
		
	d.body.insertBefore( div, d.body.firstChild );
	window.setTimeout(
		function() {
			var div = d.getElementById( id );
			if ( div ) {
				div.parentNode.removeChild( div );
			}
		}
	, 7500 ); 
}

var msg = "";

var meta = document.getElementsByTagName('meta');
for (var j in meta) {
	if (meta[j].name == "robots") {
		msg += meta[j].content + "<br/>";
	}
}

if (msg != "") {
	printBox("Robots",msg);
}

