Created
October 12, 2011 11:23
-
-
Save xiplias/1280962 to your computer and use it in GitHub Desktop.
Campfire script for Pomodoro
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
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}" |
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
## 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