Created
October 25, 2011 03:36
-
-
Save no6v/1311223 to your computer and use it in GitHub Desktop.
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 -*- | |
# show raw text (as an ascii-art :) of output from specified command | |
# Usage: | |
# * input | |
# ⚡ :aa[ENTER] | |
# [input EOF (e.g. Ctrl+D) at the last] | |
# た | |
# て | |
# が | |
# き | |
# ^D | |
# # => tweet as "た\nて\nが\nき\n" | |
# | |
# * output | |
# ⚡ :aa :status $aa | |
# ⚡ :aa :recent jugyo/aa_artists | |
Earthquake.init do | |
command %r|^:aa$|, :as => :aa do | |
puts "[input EOF (e.g. Ctrl+D) at the last]".c(:info) | |
text = STDIN.gets(nil) | |
async_e{ twitter.update(text) } if confirm("update above AA?") | |
end | |
command :aa do |m| | |
begin | |
raw_text, config[:raw_text] = config[:raw_text], true | |
input(m[1]) | |
ensure | |
config[:raw_text] = raw_text | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment