From Ape Wiki

(Redirected from Libape-controller)
Jump to: navigation, search

[edit] Inlinepush

Take a look to the Controller demo (included in the APE JSF) :

[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())