From Ape Wiki
(Redirected from Libape-controller)
[edit] Inlinepush
Take a look to the Controller demo (included in the APE JSF) :
- PHP : http://github.com/APE-Project/APE_JSF/blob/master/Demos/Controller/test.php
- JavaScript : http://github.com/APE-Project/APE_JSF/blob/master/Demos/Controller/demo.js
- HTML : http://github.com/APE-Project/APE_JSF/blob/master/Demos/Controller/demo.html
[edit] Python Sample code
Here's an example of the above PHP code written in Python (version 2.6).
import urllib2 import json server = 'http://127.0.0.1:6969/0/?' cmd = [{'cmd': 'inlinepush', 'params': { 'password': 'testpasswd', 'raw': 'mailnotif', 'channel': 'testchannel', 'data': { 'content': 'Heyyyy' } } }] url = server + urllib2.quote(json.dumps(cmd)) response = urllib2.urlopen(url) print(response.html())


