Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrtazz/katana
ready to go heroku hosted URL shortener based on guillotine
https://github.com/mrtazz/katana
Last synced: 3 days ago
JSON representation
ready to go heroku hosted URL shortener based on guillotine
- Host: GitHub
- URL: https://github.com/mrtazz/katana
- Owner: mrtazz
- License: mit
- Created: 2012-04-09T04:43:16.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-01-09T22:12:01.000Z (almost 8 years ago)
- Last Synced: 2024-11-01T10:51:30.363Z (10 days ago)
- Language: Ruby
- Homepage: unwiredcouch.com/katana
- Size: 34.2 KB
- Stars: 75
- Watchers: 4
- Forks: 25
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - mrtazz/katana - ready to go heroku hosted URL shortener based on guillotine (Ruby)
README
# Katana [![Code Climate](https://codeclimate.com/github/mrtazz/katana.png)](https://codeclimate.com/github/mrtazz/katana)
## Overview
Opinionated personal URL shortener which runs on [Heroku][1] and uses [Redis to
go][2] as a backend. Shortening is done through the fabulous [Guillotine][3]
engine and its Redis adapter.If you set `HTTP_USER` and `HTTP_PASS` all methods except `GETs` require basic
authentication.If you set `ROOT_REDIRECTS_TO_URL` traffic that GETs '/' will get redirected there.
## Usage
You can use it exactly as any other guillotine app:curl -X POST http://sho.rt --user foo:bar -i -F"url=http://github.com" -F"code=gh"
## Features
- Authentication
- Custom [Tweetbot][7] compatible endpoint## Setup
git clone git://github.com/mrtazz/katana.git
cd katana
heroku create
heroku addons:add redistogo
# or if you want to use Heroku redis
heroku addons:create heroku-redis:hobby-dev
heroku domains:add sho.rt
git push heroku master
# for authentication
heroku config:add HTTP_USER="theuser"
heroku config:add HTTP_PASS="thepass"
# for redirection
heroku config:add ROOT_REDIRECTS_TO_URL="http://www.yourlongerdomain.io"### Tweetbot
There is a custom endpoint which is compatible with how tweetbot expects custom
URL shorteners to behave. Activate it by settingTWEETBOT_API=true
in your environment variables. After that you can add URLs with a `GET` to
http://sho.rt/api/create/?url=http://github.com
Keep in mind that this endpoint is not authenticated.
## Thanks
[@technoweenie][4] for the awesome guillotine and [@roidrage][5] for
[s3itch][6] which somehow got me started wanting a personal URL shortener.[1]: http://heroku.com
[2]: http://redistogo.com
[3]: https://github.com/technoweenie/guillotine
[4]: https://twitter.com/technoweenie
[5]: https://twitter.com/roidrage
[6]: https://github.com/mattmatt/s3itch
[7]: http://tapbots.com/software/tweetbot/