Permalink
Browse files

Display profile image as Ascii-Art.

depends on jp2a and convert.
  • Loading branch information...
1 parent 4d964f3 commit 1a998b2514417f96b4cde0cf924b25dca825cfff @nanki nanki committed Nov 20, 2009
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/plugins/defaults/standard_commands.rb
View
13 lib/plugins/defaults/standard_commands.rb
@@ -114,6 +114,19 @@ def method_missing(*args, &block)
value = user.__send__(attr.to_sym)
puts "#{attr.gsub('_', ' ').rjust(label_width)}: #{value}"
end
+
+ %x(which convert)
+ aa_profile = $?.success?
+ %x(which jp2a)
+ if aa_profile && $?.success?
+ require 'open-uri'
+ IO.popen("convert - -resize 30x30 \\( -clone 0 -edge 1 \\) -average jpeg:- | jp2a - --height=30", "r+") do |convert|
+ convert.write open(user.profile_image_url){|f|f.read}
+ convert.close_write
+ puts
+ puts convert.read
+ end
+ end
},
:help => ["profile,p [USERNAME]", "Show user's profile."]
)

0 comments on commit 1a998b2

Please sign in to comment.