"whaleface" wrote:
lurking with interest over here. btw lucasgonze, since I'm assuming you are one of MOG's channel developers, thanks for tracking this forum post down. I'm excited to see if you manage to get something working.
"lucasgonze" wrote:
I have posted a version of the MOG Roku channel with support for ECP to the private channel for our betas. You can pick up the beta at https://owner.roku.com/add/mogbeta2 . This is a total hack job and I'm relying on the community to QA it.
app id="2049" version="1.82.0"
You must be logged in before using MOG via ECP. To do that use the app normally, in manual mode.
This takes up to 20 track IDs, plays them, and exits. Supply track IDs with the syntax trackID, trackID1, ..., trackID20
Given a Roku on 192.168.0.208, the playlist at http://mog.com/playlists/499366 will play on your Roku if you POST to
http://192.168.0.208:8060/launch/2049?t ... D10=302939
"lucasgonze" wrote:
Is there an ECP controller I can use for testing? Anybody have a generic web form or precompiled OS X binary?
import httplib
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
launch = lambda appID, params='': ecp_invoke('POST', '/launch/%s?%s'%(appID,params))
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('2049', 'trackID=5639969')
"lucasgonze" wrote:
This takes up to 20 track IDs, plays them, and exits. Supply track IDs with the syntax trackID, trackID1, ..., trackID20. Given a Roku on 192.168.0.208, the playlist at http://mog.com/playlists/499366 will play on your Roku if you POST to
http://192.168.0.208:8060/launch/2049?t ... D10=302939
http://192.168.0.208:8060/launch/2049?trackID=5639969&trackID1=13203815&trackID2=18362895&trackID3=10936097&trackID4=287941&trackID5=539503&trackID6=34731947&trackID7=9046631&trackID8=9925193&trackID9=302937&trackID10=302939
http://192.168.0.208:8060/launch/2049?trackIDs=5639969+13203815+18362895+10936097+287941+539503+34731947+9046631+9925193+302937+302939
"lucasgonze" wrote:
EnTerr, the way I got this done so quickly was that I happened to have a slice of free time right when this topic came up. But today I'm busy again. So if you can help get the code written for the new arg style I'm happy to make the change (or support both argument styles for the sake of "legacy" code).
My current source code is here: http://pastebin.com/n6v6VCPT
if( params["trackIDs"] <> invalid ) then
tidStr = params["trackIDs"] + " " 'extra space to simplify handling in loop
playlist = []
i = instr(1, tidStr, " ")
while i>0
digested = ecp_digest_trackID(left(tidStr, i-1))
if( digested <> invalid ) playlist.push(digested)
tidStr = mid(tidStr, i+1)
i = instr(1, tidStr, " ")
end while
end if
"EnTerr" wrote:"lucasgonze" wrote:
EnTerr, the way I got this done so quickly was that I happened to have a slice of free time right when this topic came up. But today I'm busy again. So if you can help get the code written for the new arg style I'm happy to make the change (or support both argument styles for the sake of "legacy" code).
My current source code is here: http://pastebin.com/n6v6VCPT
Ok, how about this (oops, i pasted it in pasta-bin too):
if( params["trackIDs"] <> invalid ) then
tidStr = params["trackIDs"] + " " 'extra space to simplify handling in loop
playlist = []
i = instr(1, tidStr, " ")
while i>0
digested = ecp_digest_trackID(left(tidStr, i-1))
if( digested <> invalid ) playlist.push(digested)
tidStr = mid(tidStr, i+1)
i = instr(1, tidStr, " ")
end while
end if
if( params["trackIDs"] <> invalid ) then
playlist = params["trackIDs"].Tokenize(" ")
end if