Nepal on Rails

millisami's rants!

Creating Your Own Ascii Art App

I always used to think on how to create a app that gives you back the Ascii art of the image url provided. Today I found one app named Skeeter at github that uses evented framework Goliath Documenting the installation and usage for myself which I hope someone find useful later.

Dependencies

Since there ain’t any formula for jp2a in homebrew repo, we have to install it manually.

Before installing jp2a, install jpeg with homebrew brew install jpeg

Thats it. jp2a is now installed.

Install zeromq via homebrew: brew install zeromq

Setup the app

# Clone the app
git://github.com/millisami/skeeter.git ascii-art
cd ascii-art
bundle

One gotcha, when running the ruby controllers/skeeter_controller.rb start, it gives an error due to path name mismatch. I’ve sent the pull request already. So, in the mean time, I’ve used my fork.

Now we got to start the 3 processes.

  1. ruby controllers/skeeter_controller.rb start
  2. ruby controllers/worker_controller.rb start
  3. ruby controllers/dispatcher_controller.rb start

The ruby controllers/skeeter_controller.rb start runs on port 9000.

So, to use it, go to http://localhost:9000/?image_url=http://i.imgur.com/vCdck.jpg&width=50. Notice: the image_url and width parameter which you can change as per your taste.

Thats it.