Code Monkey home page Code Monkey logo

katana's Introduction

Katana Code Climate

Overview

Opinionated personal URL shortener which runs on Heroku and uses Redis to go as a backend. Shortening is done through the fabulous Guillotine 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 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 setting

TWEETBOT_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 for the awesome guillotine and @roidrage for s3itch which somehow got me started wanting a personal URL shortener.

katana's People

Contributors

jeanfw avatar mcmar avatar mrtazz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

katana's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.