I got this on main.ape.js:
Ape.addEvent("init", function() {
include("framework/mootools.js");
include("framework/Http.js");
include("utils/utils.js");
});
Ape.registerCmd("JOIN", false, function(params, infos) {
Ape.log("+ JOIN: agregando usuario al canal " + params.channels);
var encuesta = Ape.getChannelByName(params.channels);
if(encuesta == null)
encuesta = Ape.mkChan(params.channels);
infos.user.join(params.channels);
});
Ape.registerCmd("VOTO", false, function(params, infos) {
var encuesta = Ape.getChannelByName(params.encuesta);
if(encuesta != null){
Ape.log("+ VOTO: haciendo broadcast sobre la encuesta: " +
params.encuesta);
encuesta.pipe.sendRaw('VOTO',{"key":""+params.key+""});
}
});
and I do this from Java:
import java.net.URL;
import java.net.URLConnection;
public class inline{
public static void main (String[] args){
inline i = new inline();
String r = i.push("http://www.myapeserver.com:6969/?", "1909",
"P0AIBE");
System.out.println(r);
}
public String push(String server,String idPoll, String keyword){
try{
URL url = new URL (server+"[{%22cmd%22:%22VOTO
%22,%22params%22:{%22encuesta%22:%22"+idPoll+"%22,%22key
%22:%22"+keyword+"%22}}]");
URLConnection connection =
url.openConnection();
connection.getContentLength();
} catch (Exception e) {
return ("error [inlinePush JAVA]:
"+e.getMessage());
}
return ("Success");
}
}
Some how my log on ape register two calls to the 'VOTO' command, and
in effect sends two messages to the channel.....
--
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/