Yeah..I got carried away, but you should be able to tell whats changed.
code:
var TheFile = MsgPlus.ScriptFilesPath + "\\log.txt";
var fso = new ActiveXObject("Scripting.FileSystemObject");
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
function OnEvent_Initialize(MessengerStart) {
getData();
}
function checkDupe(datum) {
if(fso.FileExists(TheFile)) {
var a = fso.OpenTextFile(TheFile, 1);
var text = a.ReadAll();
text = text.split('\r\n');
for(var i = 0;i<text.length;i++)
if(text[i] == datum) {
a.Close();
return true;
}
a.Close();
return false;
}
}
function logging(datum) {
if(fso.FileExists(TheFile)) {
if(checkDupe(datum))
return;
a = fso.OpenTextFile(TheFile, 8);
} else
var a = fso.OpenTextFile(TheFile,2,true);
a.WriteLine(datum);
a.Close();
}
function getData() {
xmlhttp.open("GET", "http://shoutbox.menthix.net/forumdisplay.php?fid=39", true);
xmlhttp.onreadystatechange = stateChanged;
xmlhttp.send(null);
}
function stateChanged() {
if (xmlhttp.readyState==4)
if (xmlhttp.status==200)
parseIt(xmlhttp.responseText);
}
function parseIt(htmls)
{
var foo = "";
var oDoc = new ActiveXObject("htmlfile");
oDoc.open();
oDoc.write(htmls);
oDoc.close();
var links = oDoc.getElementsByTagName("a");
for (var i=0; i<links.length; i++) {
foo = links[i].innerHTML.toLowerCase()
if (foo.indexOf("[request]") > -1 && !checkDupe(links[i].innerHTML)) {
MsgPlus.DisplayToast("MsgHelp.net [Request]",links[i].innerHTML,'','OpenSite');
logging(links[i].innerHTML);
}
}
}
function OpenSite() {
new ActiveXObject('WScript.Shell').run('http://shoutbox.menthix.net/forumdisplay.php?fid=39');
}
function OnEvent_Uninitialize(MessengerExit) {
}