Skip to content

Instantly share code, notes, and snippets.

@siyo
siyo / byun.rb
Created October 13, 2011 16:24
=͟͟͞͞ビ=͟͟͞͞ュ=͟͟͞͞ー=͟͟͞͞ンってやりたいとき用earthquake.gem plugin
# -*- coding: utf-8 -*-
# byun tweet / earthquake plugin
#
# e.g. :byun hoge # => update '=͟͟͞͞h=͟͟͞͞o=͟͟͞͞g=͟͟͞͞e' [Yn]
#
Earthquake.init do
command %r|^:byun\s*(\d+)*\s+(.+)$|, :as => :byun do |m|
cmd = m[1] ? ":reply #{m[1]}" : ":update"
input("%s %s" % [cmd, m[2].each_char.inject(""){|s,c| s << "=͟͟͞͞#{c}"}])