I'm sorry if my question appears silly, but why are you not using the APE JavaScript Framework that will do everything for you about this client side matters ?
Regards, -- John Chavarria - CEO / Designer Weelya - improve the Web +33 (0) 4.67.169.778 +33 (0) 6.43.56.00.83 Twitter : @jchavarria / @weelya 32 Rue du Faubourg Boutonnet 34090 Montpellier http://www.ape-project.org/ http://www.weelya.com/ On Thu, Mar 25, 2010 at 1:47 AM, Snouser <[email protected]> wrote: > I'm trying to use the APE protocol without using moo-tools-core. > > Here is what I've done so far. > > var a = Titanium.Network.createHTTPClient(); > a.open('POST','http://0.ape.domain.com:6969/0/?'); > a.send('[{"cmd":"CONNECT","chl":1},{"cmd":"JOIN","chl":2,"params": > {"channels":"testchannel"}}]'); > a.onload = function() > { > Ti.API.info('DAT!'); > > var apa = eval('(' + this.responseText + ')'); > Ti.API.info(apa[0].data.sessid); > > var x = Titanium.Network.createHTTPClient(); > x.open('POST','http://1.ape.domain.com:6969/0/?'); > x.send('[{"cmd":"CHECK","chl":3,"sessid":"' + apa[0].data.sessid + > '"}]'); > x.onload = function() > { > Ti.API.info(this.responseText); > } > } > > The problem is that the "wrong" data is being returned. > If I compare it with my browser that connects to the exact same > server. > > Here is the data being return using the code above. > > [INFO] [{"time":"1269476986","raw":"IDENT","data":{"user": > {"casttype":"uni","pubid":"894a09e1633e45891cbd178108ef34d2"}}}, > {"time":"1269476986","raw":"CHANNEL","data":{"users": > [{"casttype":"uni","pubid":"894a09e1633e45891cbd178108ef34d2","level": > 1}, > {"casttype":"uni","pubid":"522a8772c41ba459cd446a94956e7f52","level": > 1}, > {"casttype":"uni","pubid":"17b9d9e3389b7584eeb1668f68e0e586","level": > 1}, > {"casttype":"uni","pubid":"0a65bddcdebf55cd6b91d90ce441a831","level": > 1}, > {"casttype":"uni","pubid":"23c92a70cb37dc157bdc35443074630e","level": > 1}],"pipe": > > {"casttype":"multi","pubid":"c37fda4a214f3b12d6c426e757a245f7","properties": > {"name":"testchannel"}}}}] > > Here is the data being returned using moo-tools-core. > The same data is begin posted from the browser. > > [{"time":"1269477725","raw":"postmsg","data":{"message":"Some data"}}] > > Why isn't it returning the data I want? > > -- > You received this message because you are subscribed to the Google > Groups "APE Project" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<ape-project%[email protected]> > For more options, visit this group at > http://groups.google.com/group/ape-project?hl=en > --- > APE Project (Ajax Push Engine) > Official website : http://www.ape-project.org/ > Git Hub : http://github.com/APE-Project/ > > To unsubscribe from this group, send email to ape-project+ > unsubscribegooglegroups.com or reply to this email with the words "REMOVE > ME" as the subject. > -- You received this message because you are subscribed to the Google Groups "APE Project" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ape-project?hl=en --- APE Project (Ajax Push Engine) Official website : http://www.ape-project.org/ Git Hub : http://github.com/APE-Project/ To unsubscribe from this group, send email to ape-project+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
