-
-
Save maimai-swap/1578146 to your computer and use it in GitHub Desktop.
短歌が読みたくなった時用earthquake 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 -*- | |
# haiku tweet / earthquake plugin | |
# | |
# e.g. :tanka # => ここで一首、田子の浦ゆ うちいでて見れば真白にぞ 富士の高嶺に 雪は降りける | |
# :tanka hoge # => hoge ここで一首、田子の浦ゆ うちいでて見れば真白にぞ 富士の高嶺に 雪は降りける | |
# :tanka $xx # => @who ここで一首、田子の浦ゆ うちいでて見れば真白にぞ 富士の高嶺に 雪は降りける | |
# :tanka $xx hoge # => @who hoge ここで一首、田子の浦ゆ うちいでて見れば真白にぞ 富士の高嶺に 雪は降りける | |
# | |
Earthquake.init do | |
command %r|^:tanka\s*(\d+)*\s*(.*)$|, :as => :haiku do |m| | |
cmd = m[1] ? ":reply #{m[1]}" : ":update" | |
input("%s %s ここで一首、 %s" % [cmd, m[2], open("http://tanka.jgate.de/"){|f| f.read}]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment