A trivial Sinatra app that translates your messages to Glaswegian.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
ASL20.txt
Gemfile
Gemfile.lock
README.rdoc
config.ru
sleekit.rb

README.rdoc

Sleekit

Description

What was I thinking of? This is a trivial and dumb Sinatra application that will receive a piece of English text in a JSON payload and translate it to the appropriate Scottish/Glaswegian inflection. It uses an external service at whoohoo.co.uk to do the translation. You could update this code to do the other translations that they have on offer there.

I guess this tweet was what started the whole dumb idea.

Features

  • Nothing worth talking about, except for the humorous translation thing

Install

There is no gem. Uses Ruby 1.9.3 and requires Bundler. Clone it and go:

$ git clone git@github.com:oisin/sleekit.git
$ cd sleekit
$ bundle

Then you can just run the server

$ bundle exec rackup

API

You post a JSON hash with a 'text' key and the code translates the value at that key. If you don't have that key present, you'll get a 400 Bad Request.

cURL examples are always best for this kind of thing, I find.

curl -X POST -d '{"text":"Where can I get the bus?"}' http://localhost:9292/scottish

and this will return with

Whaur can Ah gie th' bus?

i.e. a simple string that is the translation.

In My Defense

This was a fast and dirty experiment to play with hpricot specifically. I thought I would put it up here so that I won't get embarrassed when the TSA search my laptop.

Authors

License

Copyright © 2011 Oisin Hurley See ASL20.txt in this directory.