Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # USAGE
- # Put this in your path.
- # echo "hello cf" | to_campfire
- require 'rubygems'
- require 'tinder'
- require 'yaml'
- # private should look like:
- # campfire:
- # username: foo@gmail.com
- # password: password
- # account: subdomain
- file_path = File.expand_path('~/.private')
- if File.exists?(file_path)
- config = YAML::load(IO.read(file_path))
- return unless cf = config.delete('campfire');
- instance = Tinder::Campfire.new(cf['account'])
- instance.login(cf['username'], cf['password'])
- room = instance.rooms.first # store a key in .private for room
- room.speak(data = STDIN.read)
- puts "I just said to #{room.name},"
- puts data
- end
Add Comment
Please, Sign In to add comment