Skip to content

Instantly share code, notes, and snippets.

@netpro2k
Created November 22, 2011 04:09
Show Gist options
  • Save netpro2k/1384867 to your computer and use it in GitHub Desktop.
Save netpro2k/1384867 to your computer and use it in GitHub Desktop.
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
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