Skip to content

Instantly share code, notes, and snippets.

@xiplias
Created October 12, 2011 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xiplias/1280962 to your computer and use it in GitHub Desktop.
Save xiplias/1280962 to your computer and use it in GitHub Desktop.
Campfire script for Pomodoro
require 'rubygems'
require 'tinder'
campfire = Tinder::Campfire.new 'ROOM_NAME', :token => 'TOKEN'
# or you can still use username/password and Tinder will look up your token
# campfire = Tinder::Campfire.new 'mysubdomain', :username => 'user', :password => 'pass'
room = campfire.find_or_create_room_by_name 'Billetto Development'
name = ARGV[1]
duration = ARGV[2]
end_time = Time.now + (60*duration.to_i)
formated_end_time = end_time.strftime("%H:%M")
case ARGV[0]
when "start"
speak = "Started '#{name}' - Ends in #{duration} minutes at #{formated_end_time}"
when "reset"
speak = ""
when "stop"
speak = ""
end
room.speak "Pomodoro: #{speak}"
## Put into the Start field in the Scripts tab in Pomodoro
do shell script "ruby /path/to/esca.rb start \"$pomodoroName\" $duration"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment