Skip to content

Instantly share code, notes, and snippets.

@no6v
Created October 25, 2011 03:36
Show Gist options
  • Save no6v/1311223 to your computer and use it in GitHub Desktop.
Save no6v/1311223 to your computer and use it in GitHub Desktop.
# -*- 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