Created
November 22, 2011 04:09
-
-
Save netpro2k/1384867 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SiriPlex < SiriPlugin | |
context :default do | |
listen_for /play (*)/i do|showName| | |
# parse season/episode if present get results from plex db | |
if noEpisodeSpecified | |
switch_context :prompt_for_episode_number | |
else | |
# play the show | |
end | |
end | |
context :prompt_for_episode_number do | |
listen_for /[1-9]+/i do |episodeNumber| | |
# play the show | |
switch_context :default | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SiriTweet < SiriPlugin | |
context :default do | |
listen_for /tweet(*)/i do|tweetText| | |
# show tweat text and prompt for confirmation | |
switch_context :confirm_tweet | |
end | |
end | |
context :confirm_tweet do | |
listen_for /yes/i do | |
# send the tweet | |
switch_context :default | |
end | |
listen_for /no/i do | |
# cancel sending | |
switch_context :default | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment