"thetick" wrote:
I got all the Roku controls working from the python command line. I could not find what I needed to build on Windows.. I'm a Windows user, but a Unix dev guy. Anyway loaded a base CentOS VM and installed gcc, python-devel, libxslt-devel, libxml2-devel and it works fine.
There shouldn't be a problem to run that thing on Windows - i have not tried but i don't think anything advanced will be needed. I used something simpler in my tinkering and know it to work in Windows:
import httplib
import urllib
def ecp_invoke(op, path):
conn = httplib.HTTPConnection(ROKU_IP, 8060)
conn.request(op, path)
r = conn.getresponse()
res = r.read() if r.status==200 else '%d[%s]=' % (r.status, r.reason)
conn.close()
return res
get_app_list = lambda: ecp_invoke('GET', '/query/apps')
keypress = lambda key: ecp_invoke('POST', '/keypress/' + key)
keydown = lambda key: ecp_invoke('POST', '/keydown/' + key)
keyup = lambda key: ecp_invoke('POST', '/keyup/' + key)
launch = lambda appID: ecp_invoke('POST', '/launch/' + appID)
send_input = lambda dict: ecp_invoke('POST', '/input?' + '&'.join(map('='.join, dict.items())))