Last active
December 16, 2015 07:59
-
-
Save siyo/5402748 to your computer and use it in GitHub Desktop.
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
# -*- coding: utf-8 -*- | |
# kakusan tweet / earthquake plugin | |
# | |
Earthquake.init do | |
command %r|^:kakusan\s+(.+)|, :as => :kakusan do |m| | |
words = %w[ 拡散希望 | |
速報 | |
RTお願いします | |
本当に大変な問題です! | |
もう時間がありません。 | |
家族や友人にもこの問題を知らせてあげてください | |
RT推奨 | |
見たらすぐリツイートを! | |
!!!緊急!!! | |
みんなに伝えたい | |
早く知らせて | |
一人でも多くの人に | |
知らないでは済まされない | |
興味がなくてもリツイートを! | |
見逃し厳禁 | |
絶対拡散 | |
できるだけ多くの人に知ってもらいたい ] | |
text = words.shuffle.inject(""){|sub,word| | |
str = "【#{word}】" | |
break sub if (sub + str + m[1]).length > 140 | |
sub << str | |
} + m[1] | |
input text | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment