Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
/ ittybe Public archive

Privacy Respecting URL Shortener built on Sinatra and Redis

License

Notifications You must be signed in to change notification settings

codeblooded/ittybe

Repository files navigation

The itty.be project is a simple url shortener which values privacy. There's no analytics, ads, or tracking software of any kind. Literally, it's just a url shortener.

Proudly built in Ruby with Sinatra as the framework and Redis as the database. It's really a single page app which makes requests over AJAX. Feel free to use it, fork the project, contribute some pull requests, and show some love with those stars.

API

Yes, you can use the API. By doing so, you agree to the Terms of Service. Give it a test drive! Send a POST request to http://itty.be/shorten with a JSON body like this:

{
    "url": "THE LONG URL GOES HERE :)"
}

And, you'll get back something like this:

{
    "url": {
        "long": "http://twitter.com/benvreed",
        "short": "http://itty.be/zdfd1"
    }
}

Deploying Your Own Shortener

This project is designed to be a backbone for building other url shorteners. It's super simple to customize. Clone the repo, and edit the config.yml file to use your domain name and adjust the length of the paths if you so choose.

Then, the project is easily deployable. It's deployed on Heroku right now, and you can successfully scale it using Heroku Redis. In the future, I hope to add docker support.

Contributing

If you're reading this section, you're already awesome! Feel free to send PRs, open issues, and share the project with your friends. As for style guidelines, I generally like to follow the bbatsov/ruby-style-guide. Logically name your commits, and don't push to the master branch if granted commit access. Master is always directly deployed on Heroku.

Testing

The itty.be url shortener is tested using rspec. You can run the tests using the following command:

$ bundle exec rspec .

License

Source code released under the MIT License. This project makes use of several open source projects licensed under different terms. Please see the Gemfile for a current listing.