I'm attempting to send a message to a specific channel from a Python
script.
I pretty sure my client JS is correct, as there are no errors and I've
confirmed the ready event fires.
On the client, I call:
channel = "messages-8486bd4e-ddb5-11e0-9f35-0026bb1b90cc";
client.core.join(channel);
client.onRaw('postmsg', function(raw, pipe) {
console.log('postmsg'+raw);
});
And in my Python script, (based on
http://www.alittletothewright.com/index.php/2010/01/comet-with-django-and-ape/),
I use urllib2 to call the url:
cmd = [{'cmd': 'inlinepush',
'params': {
'password': settings.APE_PASSWORD,
'raw': 'postmsg',
'channel': "messages-8486bd4e-ddb5-11e0-9f35-0026bb1b90cc",
'data': {
'text': message,
#'posted_by': new_msg.posted_by,
#'timestamp': new_msg.timestamp
}
}
}]
url = settings.APE_SERVER + urllib2.quote(json.dumps(cmd))
print url
response = urllib2.urlopen(url)
print response.read()
The url displayed is:
http://ape.myapp:6969/?%5B%7B%22cmd%22%3A%20%22inlinepush%22%2C%20%22params%22%3A%20%7B%22raw%22%3A%20%22postmsg%22%2C%20%22password%22%3A%20%22testpasswd%22%2C%20%22data%22%3A%20%7B%22text%22%3A%20%22hello%20there%22%7D%2C%20%22channel%22%3A%20%22messages-8486bd4e-ddb5-11e0-9f35-0026bb1b90cc%22%7D%7D%5D
However, the response read is:
[{"time":"1316102497","raw":"ERR","data":
{"code":"401","value":"UNKNOWN_CHANNEL"}}]
If I'm successfully joining the channel on the client side, why is the
server telling the Python script that the channel doesn't exist?
Thanks,
Chris
--
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/