Coder Social home page Coder Social logo

relink's Introduction

relink - A URL shortener-based on Redis, because personal URL-shortening is the new bit.ly, and because Redis is awesome

Requirements

URLs

To shorten a URL, go to the start page and enter the URL, or post to /t with url=http://www.github.com in the request body. That'll return just the shortened URL as plain text, convenient for usage in scripts to simplify shortening, see below for more details.

/p/ shows the clicks and the expanded URL

/list lists all known URLs and their click count.

Authentication

If you put a file httpasswd in the application's root directory, the app will protect most URLs (except the homepage and a shortened URL) with a http authentication. The file's format is a list of user names with a SHA1-encoded password:

redis:1be168ff837f043bde17c0314341c84271047b31

If you deploy using Capistrano, just put the htpasswd file into app_dir/shared/config, and it'll be automatically linked into the app directory.

Scripting URL shortening

Thanks to @janl for sponsoring this little AppleScript to shorten the URL currently open in Safari. Adapt for your needs.

tell application "Safari"
  set longURL to URL of front document as string
end tell

set shellScript to ("curl -X POST --url http://USER:[email protected]/t --data 'url=" & longURL & "' ")

set shortURL to (do shell script shellScript)

set the clipboard to shortURL

Use LaunchBar or QuickSilver or whatever script app you like to execute it conveniently.

Misc

The app is not tied to any specific domain. Deploy and be done with it.

License

MIT baby!

copyright 2009 Mathias Meyer [email protected]

relink's People

Contributors

alobato avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

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.