Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkosuge/4040028 to your computer and use it in GitHub Desktop.
Save kkosuge/4040028 to your computer and use it in GitHub Desktop.
ディスプレイの前でニヤニヤしてる人たちをカメラで撮る仕組み.rb
# coding: utf-8
require "chatroid"
Chatroid.new do
set :service, "Twitter"
set :consumer_key, "..."
set :consumer_secret, "..."
set :access_key, "..."
set :access_secret, "..."
on_tweet do |event|
if event["text"] =~ /笑(?:った|ってる|いが止まらない)/
`imagesnap`
end
end
end.run!
# 1. imagesnapをダウンロードして適当にパスを通してください
# https://github.com/aw/imagesnap
#
# 2. スクリプトを起動してください
# $ gem install chatroid
# $ ruby ディスプレイの前でニヤニヤしてる人たちをカメラで撮る仕組み.rb
#
# 3. 笑ってつぶやいてください
# ʅ(´◔౪◔)ʃ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment