Is it possible to run http api or python scripts in EventGhost?
#1
I would like to use EventGhost to fire off http api or (xbmc) python scripts to XBMC. It seems that the python scripts you write will only execute within xbmc and the httpapi calls have to be made through an open browser window. Are there any tricks to make them happen through EventGhost?

for example. I have a script in EG that checks for any remote activity, if there is none for a specified time it will send up a warning (OSD) and then shut down all my AV equipment. I would prefer to use the xbmc message window instead.
Reply
#2
okay, i figured out that you can use wget for windows to call the http api. Is there any other solution? Seems like i should be able to call the api from a python script within EventGhost.
Reply
#3
well to document to my own findings. I figured out how to just use urllib within EventGhosts python scripting host.

note the variables for the two parts of the notification window. It took me awhile to figure out that you had to format the text strings so that they would work in a browser, so urllib.quote is used to encode the spaces and other things that normally would not pass through.


Code:
import urllib
v_header = urllib.quote("This is the Header")
v_message = urllib.quote("This is the Message")
urllib.urlopen('http://localhost/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(' + v_header + ',' + v_message + '))')
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to run http api or python scripts in EventGhost?0