Last active
December 11, 2015 01:19
-
-
Save kkosuge/4522764 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # coding: utf-8 | |
| require "chatroid" | |
| require "im-kayac" | |
| def im_push(text) | |
| ImKayac.post(ENV["IM_KAYAC_USERNAME"], text, { :password => ENV["IM_KAYAC_PASSWORD"] }) | |
| end | |
| im_push("Start Chatroid") | |
| Chatroid.new do | |
| set :service, "Twitter" | |
| set :consumer_key, ENV["CONSUMER_KEY"] | |
| set :consumer_secret, ENV["CONSUMER_SECRET"] | |
| set :access_key, ENV["ACCESS_KEY"] | |
| set :access_secret, ENV["ACCESS_SECRET"] | |
| on_tweet do |event| | |
| if event["text"] =~ /98?m|kosuge|こすげ|コスゲ|コスゲ|小菅/i | |
| sn = event["user"]["screen_name"] | |
| via = event["source"].scan(/">(.+)</)[0][0] | |
| im_push "#{sn}: #{event["text"]}(via #{via})" | |
| end | |
| end | |
| end.run! |
This file contains hidden or 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
| source 'https://rubygems.org' | |
| gem 'chatroid' | |
| gem 'im-kayac' |
This file contains hidden or 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
| アー |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment