This file contains 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 SiriProxy::Plugin::Twitter < SiriProxy::Plugin | |
# this watches when in the default context | |
listen_for /tweet (.*)/ do |data, tweetText| | |
show_rich_snippet do | |
image 'http://cl.ly/1l040J1A392n0M1n1g35/content' # this just makes things looks nice, but is obviously specific to my username | |
text tweetText | |
end | |
# this locks out other plugins until a confirmation or deny | |
confirm do | |
confirmed do |
This file contains 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 MelbourneMetroTrains < SiriProxy::Plugin | |
trigger /when is my next train/ do |data| | |
respond_with_next_train data | |
end | |
contextual_trigger :map_show, /map/ do |data| | |
show_map Map.new(@train_details.station.coordinates) # Automatic bounding box | |
available_transitions.clear | |
end |
This file contains 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
// includes bindings for fetching/fetched | |
PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
this.page = 1; | |
}, | |
fetch: function(options) { | |
options || (options = {}); | |
this.trigger("fetching"); |