Module: Flamethrower::AsciiImager

Included in:
Campfire::Room
Defined in:
lib/flamethrower/ascii_imager.rb

Constant Summary collapse

DEFAULT_IMAGE_ASCII_SERVICE =
"http://skeeter.blakesmith.me"
DEFAULT_IMAGE_WIDTH =
80

Instance Method Summary collapse

Instance Method Details

#configObject



12
13
14
# File 'lib/flamethrower/ascii_imager.rb', line 12

def config
  @connection.server.ascii_conversion
end

#image_get(url) ⇒ Object



6
7
8
9
10
# File 'lib/flamethrower/ascii_imager.rb', line 6

def image_get(url)
  host = config['service'] || DEFAULT_IMAGE_ASCII_SERVICE
  image_width = config['scale_to_width'] || DEFAULT_IMAGE_WIDTH
  EventMachine::HttpRequest.new(host).get :query => {'image_url' => url, 'width' => image_width}
end