Skip to content

Commit

Permalink
add sad face and nyan sound FTW!
Browse files Browse the repository at this point in the history
  • Loading branch information
phoet committed Dec 30, 2011
1 parent 9bb90a4 commit ffefb04
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/karotz/client.rb
Expand Up @@ -36,6 +36,10 @@ def ears(interactive_id, params={:reset => true})
request :ears, interactive_id, params
end

def sad(interactive_id)
ears interactive_id, :left => 9, :right => 9
end

#============LED================

def led(interactive_id, params={})
Expand Down Expand Up @@ -72,6 +76,10 @@ def multimedia(interactive_id, params={})
end
alias :play :multimedia

def nyan(interactive_id)
multimedia interactive_id, :url => "http://api.ning.com:80/files/3zmSvhA*3jKxFJj1I5uh5dp5oCynyyMksQjwS3JWWQNlriTzDzX61KtlFnuQtx-hEmV7NdqVgofmZvh7cXOX-UVJ47m1SR4a/nyanlooped.mp3"
end

#============WEBCAM=========

def webcam(interactive_id, params={})
Expand Down Expand Up @@ -103,6 +111,8 @@ def start
def stop(interactive_id, params={})
request(:interactivemode, interactive_id, {:action => :stop}.merge(params))
end
alias :destroy :stop
alias :disconnect :stop

def session # TODO multimedia-api is not blocking, so we need some whay to find out when we can kill the session properly
client = create
Expand All @@ -111,12 +121,13 @@ def session # TODO multimedia-api is not blocking, so we need some whay to find
stop(client.interactive_id) if client
end

#===========HELPERS================

def create
interactive_id = start
new(interactive_id)
end
alias :connect :create

#===========HELPERS================

def start_url(install_id, api_key, secret, once=rand(99999999999999), timestamp=Time.now.to_i)
params = {
Expand Down

0 comments on commit ffefb04

Please sign in to comment.