I'm trying to get my basic auto current twitter status in my personal message box automatically and refresh every 5 seconds, what am I doing wrong:
code:
var request = new ActiveXObject("Microsoft.XMLHTTP");
var serverResponse = "";
function getData()
{
var TYPE = "GET"; //use GET to request information and POST to send information
var URI = "http://twitter.com/statuses/user_timeline/__XD__.json"; //whatever server and or form you want to communicate with
var ASYNC = true; //if false script will pause until the request is complete
request.open(TYPE, URI, ASYNC);
request.send(null);
request.onreadystatechange = processReadyStateChange();
}
function processReadyStateChange()
{
Messenger.MyPersonalMessage = "Twitter: Loading...";
if(request.readyState == 4 && request.status == 200)
{
json = eval( request.responseText )
Messenger.MyPersonalMessage = "Twitter: " + json[0].text
}
}
function OnEvent_Initialize(MessengerStart)
{
MsgPlus.AddTimer("Timer",5000); //called every 5 second
getData()
}
function OnEvent_Timer(TimerId) {
if(TimerId == 'Timer') {
getData();
MsgPlus.AddTimer("Timer",5000); //called every 5 second
}
}
function OnEvent_Uninitialize(MessengerExit)
{
}
I couldn't find answer after searching, so I just joined
hey everyone!