Code: Select all
HTTP.EchoToEG [u'turn on and watch NBC']Code: Select all
Main.EchoToEG.turn on and watch NBCI would then want 3 events:
- Main.EchoToEG.turn on
- Main.EchoToEG.watch Fox Sports Midwest
- Main.EchoToEG.turn the volume up
Code: Select all
HTTP.EchoToEG [u'turn on and watch NBC']Code: Select all
Main.EchoToEG.turn on and watch NBCCode: Select all
suffixes= eg.event.payload[0].split(' and ')
for suffix in suffixes:
# the 2 options below will give you a "pretty" event suffix this is if you
# are not using the actual suffix for anything other then just triggering
# an event
# remove the # before the next line if you would like all the first letters
# in the suffix to be capital but not to mess with anything that might be
# like NBC it will stay the same
#suffix = ' '.join(list(word[0].upper() + word[1:] for word in suffix.split(' ')))
# remove the # from the next line if you would like to remove all of the
# spaces from the suffix
#suffix = suffix.replace(' ', '')
# swap the # between these 2 depending if you want to have the "Main."
# in your event
eg.TriggerEvent(prefrix='EchoToEG', suffix=suffix)
#eg.TriggerEvent(suffix='EchoToEG.' + suffix)