VF Alerter

By possumboy Last update Mar 28, 2008 — Installed 106 times. Daily Installs: 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 1
// ==UserScript==
// @name           VF Alerter
// @namespace      http://vampirefreaks.com/possumboy
// @description    Vampirefreaks.com alerter. Will tell you when you have new messages etc.
// @include        *
// ==/UserScript==

GM_xmlhttpRequest({
    method: 'GET',
    url: 'http://vampirefreaks.com/serv/notify.php',
    headers: {
        'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
        'Accept': 'text/xml',
    },

    onload: function(responseDetails) {
	response = responseDetails.responseText;
	inbox = response.match("<inbox>1</inbox>");
	if(inbox != null){
	  var newInbox = "1"
	}
	comments = response.match("<comments>1</comments>");
	if(comments != null){
	  var newComments = "1";
	}
	picComments = response.match("<pic_comments>1</pic_comments>");
	if(picComments != null){
	  var newPComments = "1";
	}


function createNot(){
	if(newPComments != null || newComments != null || newInbox != null){

	d = window.document.createElement("div");
	d.setAttribute("id", "vf_notifyer");
	d.setAttribute("class", "vfnotifyer");
	d.setAttribute("style", "z-index: 1!important; position: fixed; bottom: 0; right: 0; width: 130px; margin: 0px!important; border: 0px!important; padding: 0px!important; display: table!important; visibility: visible!important;");

	t = window.document.createElement("div");
	t.setAttribute("id", "vf_notifyer_top");
	t.setAttribute("class", "vf_notifyer_top");
	top_lbl = window.document.createElement("img")
        top_lbl.setAttribute("src", "http://i27.tinypic.com/wskax5.gif");
	top_lbl.setAttribute("style", "height: 13px!important; border: 0px none ! important; margin: 0px ! important; padding: 0px ! important; display: table ! important; visibility: visible ! important;");
	t.appendChild(top_lbl);
	d.appendChild(t);

	m = window.document.createElement("div");
	m.setAttribute("id", "vf_notifyer_mid");
	m.setAttribute("class", "vf_notifyer_mid");
	m.setAttribute("style", "z-index: 1!important; height: 13px !important; background-color: #000000; text-align: left!important; width: 127px!important; padding: 0px!important; padding-left: 3px!important; color: #ffffff!important; font-size: 12px!important; font-family: arial!important; border: 0px!important; display: table!important; visibility: visible!important;");
	d.appendChild(m);

	bt = window.document.createElement("div");
	bt.setAttribute("id", "vf_notifyer_bot");
	bt.setAttribute("class", "vf_notifyer_bot");
	bt.setAttribute("style", "margin: 0px!important; border: 0px!important; padding: 0px!important; display: table!important; visibility: visible!important;");

	bot_lbl = window.document.createElement("img");
        bot_lbl.setAttribute("src", "http://i29.tinypic.com/ouy7b7.jpg");
	bot_lbl.setAttribute("style", "height: 34px!important; border: 0px none ! important; margin: 0px ! important; padding: 0px ! important; display: table ! important; visibility: visible ! important;");
	bt.appendChild(bot_lbl);
	d.appendChild(bt);

	var b = document.getElementsByTagName("body")[0];
	b.appendChild(d);
	br = window.document.createElement("br");

	if(newInbox != null){
	ilink = document.createElement("a");
	ilink.setAttribute("href", "http://vampirefreaks.com/inbox.php");
	ilink.setAttribute("target", "_blank");
	ilink.setAttribute("style", "z-index: 1!important; background-color: transparent!important; color: #ffffff!important; text-decoration: none!important; font-family: arial!important; font-size: 12px!important; font-weight: normal;");

	inlbl = document.createTextNode("Inbox Messages");
	ilink.appendChild(inlbl);
	m.appendChild(ilink);
	m.appendChild(br);
	}

	if(newComments != null){
	clink = document.createElement("a");
	clink.setAttribute("href", "http://vampirefreaks.com/comments.php");
	clink.setAttribute("target", "_blank");
	clink.setAttribute("style", "background-color: transparent!important; color: #ffffff!important; text-decoration: none!important; font-family: arial!important; font-size: 12px!important; font-weight: normal;");

	cmlbl = document.createTextNode("Comments");
	clink.appendChild(cmlbl);
	m.appendChild(clink);

	m.appendChild(br);
	}

	if(newPComments != null){
	pclink = document.createElement("a");
	pclink.setAttribute("href", "http://vampirefreaks.com/view_pic_comments.php");
	pclink.setAttribute("target", "_blank");
	pclink.setAttribute("style", "background-color: transparent!important; color: #ffffff!important; text-decoration: none!important; font-family: arial!important; font-size: 12px!important; font-weight: normal;");

	pcmlbl = document.createTextNode("Pic Comments");
	pclink.appendChild(pcmlbl);
	m.appendChild(pclink);
	m.appendChild(br);
	}
	}

}
	if(top.location == location) {
	createNot();
	}    
	}
});