Skip to content
TinyURL service in Ramaze
Find file
New pull request
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


TinyURL Ramaze Application

Required gems

sqlite3-ruby, sequel, validatable, ramaze, thin


- everything in one file - model, view, controller
- auto create the database if missing
- unique urls in the database 
- url hits counting
- API for command-line access - can shorten urls and restore the original urls


 $ curl -O turl.rb ""
 $ ruby turl.rb
 # browse http://localhost:7000/
 # shorten url (turl)
 $ curl http://admin:secret@localhost:7000/_api?turl=
 # restore the original url
 $ curl http://admin:secret@localhost:7000/_api?url=abc
 # number of hints for given turl
 $ curl http://admin:secret@localhost:7000/_api?hits=abc

Do not forget to change the BASE_URL and LOGINS values. By default the database 
file (sqlite3) will be created in the same directory with turl.rb. If this is not 
acceptable, change the DB_FILE line.
Something went wrong with that request. Please try again.