-
-
Save siyo/1655929 to your computer and use it in GitHub Desktop.
ひっくり返してtweetするしパクってひっくり返すやつ/ earthquake.gem plugin
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 -*- | |
# reverse tweet | |
# | |
# e.g. :reverse hoge #=> egoh | |
# or | |
# :reverse $aa #=> reverse RT | |
# | |
Earthquake.init do | |
command %r|^:reverse\s(.+)$|, :as => :reverse do |m| | |
txt = if /^\d+$/ =~ m[1] | |
(st = cache.read("status:#{m[1].to_i}")) ? st["text"] : nil | |
else | |
m[1] | |
end | |
if txt | |
input txt.split(//).reverse.join | |
else | |
puts "Not found tweet." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment