Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
I like to know if it would be possible to use Eventghost to send a HTTP request to my Popcorn Hour A-400 and trigger an event on the received XML output.
Forn instance when I send the command:
http://<A-400>:8008/playback?arg0=get_current_vod_info I receive the playback status in XML syntax:
import urllib
import xml.dom.minidom
response = urllib.urlopen('http://<A-400>:8008/playback?arg0=get_current_vod_info') #assumes the response is ready to parse into xml
status = dom.getElementsByTagName('theDavidBox')[0].getElementsByTagName('response')[0].getElementsByTagName('currentStatus')[0].firstChild.data #ugly, but should work - or something like it
eg.TriggerEvent('PopcornPlayStatus.' + status) #trigger an event based on the status
import urllib
import xml.dom.minidom
from xml.dom.minidom import parse
response = urllib.urlopen('http://172.19.3.210:8008/playback?arg0=get_current_vod_info') #assumes the response is ready to parse into xml
dom = parse (response)
#status = dom.getElementsByTagName('theDavidBox')[0].getElementsByTagName('response')[0].getElementsByTagName('currentStatus')[0].firstChild.data #ugly, but should work - or something like it
status = dom.getElementsByTagName('theDavidBox')[0].getElementsByTagName('returnValue')[0].firstChild.data
eg.TriggerEvent('PopcornPlayStatus.' + status) #trigger an event based on the status
DarkCinema wrote:I like to know if it would be possible to use Eventghost to send a HTTP request to my Popcorn Hour A-400 and trigger an event on the received XML output.
Forn instance when I send the command:
http://<A-400>:8008/playback?arg0=get_current_vod_info I receive the playback status in XML syntax: