What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » help me fix my script please

help me fix my script please
Author: Message:
AberNStein
Full Member
***


Posts: 132
Reputation: 2
Joined: Jul 2006
O.P. RE: help me fix my script please
thanks a bunch.
i've gotten quite far now with the script actually.
i'll post another version once i'm really stumped again though.

edit: here we go.
so the purpose of this script is to scrape the scripts forum and toast if there are any new requests. right now it scrapes the forum, and toasts any link with [request] (case insensitive) in it, and then it writes them to a text file. the goal is to have it check that text file before it toasts and then not toast if the thread is already there. i'll add the timer later.
p.s. there's a runtime error on line one or something, i'd rather supress it than figure it out. oh yeah and it toasts and logs twice for each one.
p.p.s. i write ugly code. don't laugh.
code:
function OnEvent_Initialize(MessengerStart)
{
getData();
}

function logging(datum)
{
var fso;
var ForAppending = 8;
var TheFile = MsgPlus.ScriptFilesPath + "\log.txt";
fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.OpenTextFile(TheFile, ForAppending, true);
a.WriteLine(datum);
a.Close();
}

var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

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);
    }
  else
    {
    }
  }
}

function parseIt(htmls)
{
var foo = "";
var oDoc = new ActiveXObject("htmlfile");
oDoc.open();
oDoc.write(htmls);
oDoc.close();
var links = oDoc.getElementsByTagName("a");
for (i=0; i<links.length; i++)
{
foo = links[i].innerHTML.toLowerCase()
if (foo.indexOf("[request]") > -1)
{
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)
{
}


This post was edited on 07-14-2006 at 03:01 AM by AberNStein.
[Image: gybouserbar6hc.gif]
07-14-2006 01:57 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
help me fix my script please - by AberNStein on 07-14-2006 at 12:14 AM
RE: help me fix my script please - by luisillo on 07-14-2006 at 12:27 AM
RE: help me fix my script please - by AberNStein on 07-14-2006 at 01:07 AM
RE: help me fix my script please - by BstrdSmkr on 07-14-2006 at 01:45 AM
RE: help me fix my script please - by AberNStein on 07-14-2006 at 01:57 AM
RE: help me fix my script please - by AberNStein on 07-14-2006 at 09:00 PM
RE: help me fix my script please - by Silentdragon on 07-14-2006 at 09:42 PM
RE: help me fix my script please - by AberNStein on 07-15-2006 at 01:26 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On