Skip to content

Instantly share code, notes, and snippets.

View monoxgas's full-sized avatar

Nick Landers monoxgas

View GitHub Profile
{"class"=>"AddViews",
"properties"=>
{"temporary"=>false,
"dialogPhase"=>"Summary",
"scrollToTop"=>false,
"views"=>
[{"class"=>"AssistantUtteranceView",
"properties"=>
{"dialogIdentifier"=>"AnswerFacts#noResults",
"speakableText"=>
listen_for /test button/i do
add_views = SiriAddViews.new
add_views.make_root(last_ref_id)
button = SiriButton.new
button.text << "Button1"
newUtterance = SiriAssistantUtteranceView.new("Clicked!")
startRequest = SiriStartRequest.new(newUtterance, false, true)
sendCommand = SiriSendCommands.new
sendCommand.commands << startRequest
#button.commands << SiriSendCommands.new(SiriStartRequest.new(SiriAssistantUtteranceView.new("Clicked!"), false, true))
port: 443
log_level: 1
plugins:
# NOTE: run bundle after changing plugin configurations to update required gems
# - name: 'Example'
# path: './plugins/siriproxy-example'
# - name: 'Thermostat'
# git: 'git://github.com/plamoni/SiriProxy-Thermostat.git'
@monoxgas
monoxgas / Config.yml
Created December 10, 2011 06:42 — forked from anonymous/Config.yml
My Config File
port: 443
log_level: 1
plugins:
# NOTE: run bundle after changing plugin configurations to update required gems
- name: 'Example'
path: './plugins/siriproxy-example'
# - name: 'Thermostat'
# git: 'git://github.com/plamoni/SiriProxy-Thermostat.git'
@monoxgas
monoxgas / Ex RB
Created December 10, 2011 06:41 — forked from anonymous/Ex RB
Example RB
require 'cora'
require 'siri_objects'
require 'pp'
#######
# This is a "hello world" style plugin. It simply intercepts the phrase "test siri proxy" and responds
# with a message about the proxy being up and running (along with a couple other core features). This
# is good base code for other plugins.
#
# Remember to add other plugins to the "config.yml" file if you create them!
@monoxgas
monoxgas / Config.yml
Created December 10, 2011 06:42 — forked from anonymous/Config.yml
My Config File
port: 443
log_level: 1
plugins:
# NOTE: run bundle after changing plugin configurations to update required gems
- name: 'Example'
path: './plugins/siriproxy-example'
# - name: 'Thermostat'
# git: 'git://github.com/plamoni/SiriProxy-Thermostat.git'
port: 443
log_level: 1
plugins:
# NOTE: run bundle after changing plugin configurations to update required gems
- name: 'Example'
path: '/Users/Equinox/SiriProxy/plugins/siriproxy-example'
# - name: 'Thermostat'
# git: 'git://github.com/plamoni/SiriProxy-Thermostat.git'
@monoxgas
monoxgas / gist:1454744
Created December 10, 2011 06:57
Copying the siriproxy-example plugin
1. Copy the siriproxy-example folder and rename it to siriproxy-*plugin*
2. open the gemspec file in your new plugin folder and change both of the plugin names to "siriproxy-*plugin*"
3. Open your .rb file in your plugin file/lib/ and change the line SiriProxy::Plugin::Example to SiriProxy::Plugin::*PluginName*
3. Open your config.yml and copy the Example plugin lines, make sure the spacing stays EXACTLY the same! Change Name: to *PluginName* from step 3, and change path to "/Users/*username*/SiriProxy/plugins/siriproxy-*plugin*/"
filter "StartRequest", direction: :from_iphone do |object|
puts "[Info - Button Information] #{object["properties"]}"
say "I don't have any #{object["properties"]["utterance"].capitalize} muffins, sorry..." #Fails Here, Logs the Say but never actually says it
object = false #After a while, it will google search my utterance I used
end
def createButton(text, utterance, command)
startRequest = SiriStartRequest.new(text, false, true) #Does the true proxyOnly parameter matter here?
sendCommand = SiriSendCommands.new
@monoxgas
monoxgas / siriproxy-nick.rb
Created December 10, 2011 19:34 — forked from laxman01/siriproxy-nick.rb
siriproxy-nick.rb
require 'cora'
require 'siri_objects'
require 'pp'
class SiriProxy::Plugin::Nick < SiriProxy::Plugin
def initialize(config)
#if you have custom configuration options, process them here!
end