i've got a script doing pretty much that. i had a thread about it a while ago.
the checkdupe(datum) function checks whether the given input is in the logfile (returns true or false), and the logging(datum) saves the given input to the logfile
getdata() reads the given website, and then calls parseTt(htmls).
in my script, parseIt iterates through all the links in the page, then for each one with "[release]" in the link's innerHTML that isn't already in the logfile, it pops up a toast. then it adds it to the logfile. pretty straightforward really.
oh and the script might give you a runtime error. ignore it.
right now it just goes when i start up messenger but it wouldn't be hard to make it go every 10 mins or whatever. just call getData();
code:
function OnEvent_Initialize(MessengerStart) {
}
var TheFile = MsgPlus.ScriptFilesPath + "\\log.txt";
var fso = new ActiveXObject("Scripting.FileSystemObject");
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
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("[release]") > -1 && !checkDupe(links[i].innerHTML)) {
MsgPlus.DisplayToast("MsgHelp.net [Release]",links[i].innerHTML,'','OpenSite',links[i].HREF);
logging(links[i].innerHTML);
}
}
}
function OpenSite(url) {
new ActiveXObject('WScript.Shell').run('http://shoutbox.menthix.net/' + url);
}
function OnEvent_Uninitialize(MessengerExit) {
}
edit: for some reason OpenSite(url) isn't working properly. i'd much appreciate it if someone could go over my code and improve it. if not, i'll fix it when i get back (i'm going away for two weeks).