Created
April 3, 2011 05:16
-
-
Save rummelonp/900215 to your computer and use it in GitHub Desktop.
コマンドラインから簡単にBoxcarにメッセージを送信するためのRubyスクリプト
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
--- | |
:email: mail@example.com | |
:password: password |
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
#!/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