Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created April 3, 2011 05:16
Show Gist options
  • Save rummelonp/900215 to your computer and use it in GitHub Desktop.
Save rummelonp/900215 to your computer and use it in GitHub Desktop.
コマンドラインから簡単にBoxcarにメッセージを送信するためのRubyスクリプト
---
:email: mail@example.com
:password: password
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'boxcar_api'
require 'yaml'
module Boxcar
extend self
@account_path = File.join Dir.home, '.boxcar.yml'
@account = YAML.load_file(@account_path)
@boxcar = BoxcarAPI::User.new(@account[:email], @account[:password])
def method_missing(method, *args, &block)
return super unless @boxcar.respond_to?(method)
@boxcar.send(method, *args, &block)
end
def respond_to?(method)
return @boxcar.respond_to?(method) || super
end
end
if __FILE__ == $0
Boxcar.notify(*ARGV)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment